Add trailing metadata for unary/client-streaming

This commit is contained in:
Lucio Franco
2019-08-28 23:15:05 -04:00
parent bfab56d42d
commit 91a3c0965a
5 changed files with 34 additions and 25 deletions
+14 -17
View File
@@ -402,22 +402,21 @@ pub async fn custom_metadata(client: &mut Client, assertions: &mut Vec<TestAsser
req_stream.metadata_mut().insert(key1, value1.clone());
req_stream.metadata_mut().insert_bin(key2, value2.clone());
// let response = client
// .unary_call(req_unary)
// .await
// .expect("call should pass.");
// assertions.push(test_assert!(
// "metadata string must match in unary",
// response.metadata().get(key1) == Some(&value1),
// format!("result={:?}", response.metadata().get(key1))
// ));
// assertions.push(test_assert!(
// "metadata bin must match in unary",
// response.metadata().get_bin(key2) == Some(&value2),
// format!("result={:?}", response.metadata().get_bin(key1))
// ));
let response = client
.unary_call(req_unary)
.await
.expect("call should pass.");
assertions.push(test_assert!(
"metadata string must match in unary",
response.metadata().get(key1) == Some(&value1),
format!("result={:?}", response.metadata().get(key1))
));
assertions.push(test_assert!(
"metadata bin must match in unary",
response.metadata().get_bin(key2) == Some(&value2),
format!("result={:?}", response.metadata().get_bin(key1))
));
let response = client
.full_duplex_call(req_stream)
@@ -432,8 +431,6 @@ pub async fn custom_metadata(client: &mut Client, assertions: &mut Vec<TestAsser
let mut stream = response.into_inner();
// while let Some(_) = stream.next().await {}
let trailers = stream.trailers().await.unwrap().unwrap();
assertions.push(test_assert!(