Skip to content
This repository was archived by the owner on May 9, 2022. It is now read-only.

Commit 17bb90f

Browse files
committed
test(rtc_data_service): web_api/data_upload: better failure reporting
1 parent 0845839 commit 17bb90f

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

rtc_data_service/tests/web_api/data_upload.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
use std::convert::TryInto;
44
use std::path::Path;
55

6-
use actix_web::test;
6+
use actix_web::web::Bytes;
7+
use actix_web::{http, test};
78
use rtc_data_service::data_upload::models;
89
use sgx_types::sgx_target_info_t;
910
use uuid::Uuid;
@@ -57,10 +58,17 @@ async fn data_service_data_upload_ok() {
5758
.to_request();
5859

5960
let resp = test::call_service(&app, req).await;
61+
let status: http::StatusCode = resp.status();
62+
let body: Bytes = test::read_body(resp).await;
63+
64+
assert!(
65+
status.is_success(),
66+
"status = {}, body = {:?}",
67+
status,
68+
body
69+
);
6070

61-
assert!(resp.status().is_success());
62-
63-
let body: models::ResponseBody = serde_json::from_slice(&test::read_body(resp).await).unwrap();
71+
let body: models::ResponseBody = serde_json::from_slice(&body).unwrap();
6472

6573
// NOTE: re-add padding since sodalite supports the C-style nacl api
6674
let mut m = vec![0_u8; body.ciphertext.len() + CRYPTO_BOX_BOXZEROBYTES];

0 commit comments

Comments
 (0)