Skip to content

Commit

Permalink
use warp::path! instead of warp::path in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dlachaume committed Oct 12, 2023
1 parent f53cc8e commit 2498228
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions mithril-client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ mod tests {
let snapshot_message = SnapshotMessage::dummy();
let json_snapshot_message = serde_json::to_string(&snapshot_message)?;
let http_server = test_http_server(
warp::path("artifact")
.and(warp::path("snapshot"))
.and(warp::path::param())
.map(move |_digest: String| json_snapshot_message.clone()),
warp::path!("artifact" / "snapshot" / String)
.map(move |_digest| json_snapshot_message.clone()),
);
let client = Client::new("WRITE THE VKEY HERE", &http_server.url()).await?;
let response = client.show_snapshot(&snapshot_message.digest).await?;
Expand All @@ -78,9 +76,7 @@ mod tests {
];
let json_snapshot_list_message = serde_json::to_string(&snapshot_list_message)?;
let http_server = test_http_server(
warp::path("artifact")
.and(warp::path("snapshots"))
.map(move || json_snapshot_list_message.clone()),
warp::path!("artifact" / "snapshots").map(move || json_snapshot_list_message.clone()),
);
let client = Client::new("WRITE THE VKEY HERE", &http_server.url()).await?;
let response = client.list_snapshot().await?;
Expand Down

0 comments on commit 2498228

Please sign in to comment.