diff options
author | Alex <alex@adnab.me> | 2022-10-18 14:20:44 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2022-10-18 14:20:44 +0000 |
commit | 5670599372f6c3c60dcd74279a0741248fc510c3 (patch) | |
tree | 2852a5e3cf2a0d1728b7d67e59e1b13aaae92287 /src/garage/tests/k2v/batch.rs | |
parent | 7bc9fd34b250384d1b80ed28dc6c9e6abcda69ae (diff) | |
parent | f1c96d108c29ae4ef7b1f7ed8f2c06b6a5744909 (diff) | |
download | garage-5670599372f6c3c60dcd74279a0741248fc510c3.tar.gz garage-5670599372f6c3c60dcd74279a0741248fc510c3.zip |
Merge pull request 'Use status code 204 No Content for empty responses' (#403) from tobikris/garage:http-no-content into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/403
Diffstat (limited to 'src/garage/tests/k2v/batch.rs')
-rw-r--r-- | src/garage/tests/k2v/batch.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/garage/tests/k2v/batch.rs b/src/garage/tests/k2v/batch.rs index acae1910..6abba1c5 100644 --- a/src/garage/tests/k2v/batch.rs +++ b/src/garage/tests/k2v/batch.rs @@ -6,7 +6,7 @@ use assert_json_diff::assert_json_eq; use serde_json::json; use super::json_body; -use hyper::Method; +use hyper::{Method, StatusCode}; #[tokio::test] async fn test_batch() { @@ -49,7 +49,7 @@ async fn test_batch() { .send() .await .unwrap(); - assert_eq!(res.status(), 200); + assert_eq!(res.status(), StatusCode::NO_CONTENT); for sk in ["a", "b", "c", "d.1", "d.2", "e"] { let res = ctx @@ -62,7 +62,7 @@ async fn test_batch() { .send() .await .unwrap(); - assert_eq!(res.status(), 200); + assert_eq!(res.status(), StatusCode::OK); assert_eq!( res.headers().get("content-type").unwrap().to_str().unwrap(), "application/octet-stream" @@ -104,7 +104,7 @@ async fn test_batch() { .send() .await .unwrap(); - assert_eq!(res.status(), 200); + assert_eq!(res.status(), StatusCode::OK); let json_res = json_body(res).await; assert_json_eq!( json_res, @@ -266,7 +266,7 @@ async fn test_batch() { .send() .await .unwrap(); - assert_eq!(res.status(), 200); + assert_eq!(res.status(), StatusCode::NO_CONTENT); for sk in ["b", "c", "d.1", "d.2"] { let res = ctx @@ -280,9 +280,9 @@ async fn test_batch() { .await .unwrap(); if sk == "b" { - assert_eq!(res.status(), 204); + assert_eq!(res.status(), StatusCode::NO_CONTENT); } else { - assert_eq!(res.status(), 200); + assert_eq!(res.status(), StatusCode::OK); } ct.insert( sk, @@ -317,7 +317,7 @@ async fn test_batch() { .send() .await .unwrap(); - assert_eq!(res.status(), 200); + assert_eq!(res.status(), StatusCode::OK); let json_res = json_body(res).await; assert_json_eq!( json_res, @@ -478,7 +478,7 @@ async fn test_batch() { .send() .await .unwrap(); - assert_eq!(res.status(), 200); + assert_eq!(res.status(), StatusCode::OK); let json_res = json_body(res).await; assert_json_eq!( json_res, @@ -514,7 +514,7 @@ async fn test_batch() { .send() .await .unwrap(); - assert_eq!(res.status(), 204); + assert_eq!(res.status(), StatusCode::NO_CONTENT); assert_eq!( res.headers().get("content-type").unwrap().to_str().unwrap(), "application/octet-stream" @@ -547,7 +547,7 @@ async fn test_batch() { .send() .await .unwrap(); - assert_eq!(res.status(), 200); + assert_eq!(res.status(), StatusCode::OK); let json_res = json_body(res).await; assert_json_eq!( json_res, |