Skip to content

Commit

Permalink
add unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun committed Jul 8, 2022
1 parent 3f5697a commit d2841ab
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions query/tests/it/servers/http/http_query_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,20 @@ async fn test_download(v2: u64) -> Result<()> {
fmt
);
}

// test download with limits
let uri = format!("/v1/query/{query_id}/download?limit=1");
let resp = get_uri(&ep, &uri).await;
assert_eq!(resp.status(), StatusCode::OK, "{:?}", resp);
let exp = "0,1\n";
assert_eq!(resp.into_body().into_string().await.unwrap(), exp);

let uri = format!("/v1/query/{query_id}/download?limit=0");
let resp = get_uri(&ep, &uri).await;
assert_eq!(resp.status(), StatusCode::OK, "{:?}", resp);
let exp = "0,1\n1,2\n";
assert_eq!(resp.into_body().into_string().await.unwrap(), exp);

Ok(())
}

Expand Down

0 comments on commit d2841ab

Please sign in to comment.