Skip to content

Commit

Permalink
Test size of the blob response
Browse files Browse the repository at this point in the history
  • Loading branch information
anti-social committed May 9, 2022
1 parent e2104ec commit e720262
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/mock/blobs_download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,12 @@ fn get_blobs_stream() -> Fallible<()> {
.build()
.unwrap();

let futcheck = dclient.get_blob_stream(&name, &digest);

let mut result_stream = runtime.block_on(futcheck)?;
let stream_output = result_stream.next().now_or_never();
let futcheck = dclient.get_blob_response(&name, &digest);

let blob_resp = runtime.block_on(futcheck)?;
assert_eq!(blob_resp.size(), Some(5));
let stream_output = blob_resp.stream().next().now_or_never();
let output = stream_output.unwrap_or_else(|| panic!("No stream output"));
let received_blob = output.unwrap_or_else(|| panic!("No blob data"))?;
assert_eq!(blob.to_vec(), received_blob);
Expand Down

0 comments on commit e720262

Please sign in to comment.