Skip to content

Commit

Permalink
fix: remove unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
bkioshn committed Jan 26, 2024
1 parent 55f1825 commit 124b55d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
33 changes: 19 additions & 14 deletions catalyst-gateway/tests/integration/catalyst_gateway_event_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,23 @@ async fn health_live() {
let client = reqwest::Client::new();
let url = format!("{cat_gateway_address}/api/health/live");

let response = unwrap!(
client.get(&url).send().await,
"Failed to execute request to {url}."
);
assert_eq!(
response.status().as_u16(),
204,
"request failed for {url} response: {response:#?}"
);
assert_eq!(
Some(0),
response.content_length(),
"request failed for {url} response: {response:#?}"
);
let response = client.get(&url).send().await;

match response {
Ok(res) => {
assert_eq!(
res.status().as_u16(),
204,
"request failed for {url} response: {res:#?}"
);
assert_eq!(
Some(0),
res.content_length(),
"request failed for {url} response: {res:#?}"
);
},
Err(err) => {
eprint!("request failed for {url} error: {err:#?}")
},
}
}
2 changes: 0 additions & 2 deletions catalyst-gateway/tests/integration/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
#[macro_use]
extern crate unwrap;
pub mod catalyst_gateway_event_db;

0 comments on commit 124b55d

Please sign in to comment.