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/errorcodes.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/errorcodes.rs')
-rw-r--r-- | src/garage/tests/k2v/errorcodes.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/garage/tests/k2v/errorcodes.rs b/src/garage/tests/k2v/errorcodes.rs index 2fcc45bc..ecb84729 100644 --- a/src/garage/tests/k2v/errorcodes.rs +++ b/src/garage/tests/k2v/errorcodes.rs @@ -1,13 +1,13 @@ use crate::common; -use hyper::Method; +use hyper::{Method, StatusCode}; #[tokio::test] async fn test_error_codes() { let ctx = common::context(); let bucket = ctx.create_bucket("test-k2v-error-codes"); - // Regular insert should work (code 200) + // Regular insert should work (code 204) let res = ctx .k2v .request @@ -19,7 +19,7 @@ async fn test_error_codes() { .send() .await .unwrap(); - assert_eq!(res.status(), 200); + assert_eq!(res.status(), StatusCode::NO_CONTENT); // Insert with trash causality token: invalid request let res = ctx @@ -34,7 +34,7 @@ async fn test_error_codes() { .send() .await .unwrap(); - assert_eq!(res.status(), 400); + assert_eq!(res.status(), StatusCode::BAD_REQUEST); // Search without partition key: invalid request let res = ctx @@ -52,7 +52,7 @@ async fn test_error_codes() { .send() .await .unwrap(); - assert_eq!(res.status(), 400); + assert_eq!(res.status(), StatusCode::BAD_REQUEST); // Search with start that is not in prefix: invalid request let res = ctx @@ -70,7 +70,7 @@ async fn test_error_codes() { .send() .await .unwrap(); - assert_eq!(res.status(), 400); + assert_eq!(res.status(), StatusCode::BAD_REQUEST); // Search with invalid json: 400 let res = ctx @@ -88,7 +88,7 @@ async fn test_error_codes() { .send() .await .unwrap(); - assert_eq!(res.status(), 400); + assert_eq!(res.status(), StatusCode::BAD_REQUEST); // Batch insert with invalid causality token: 400 let res = ctx @@ -105,7 +105,7 @@ async fn test_error_codes() { .send() .await .unwrap(); - assert_eq!(res.status(), 400); + assert_eq!(res.status(), StatusCode::BAD_REQUEST); // Batch insert with invalid data: 400 let res = ctx @@ -122,7 +122,7 @@ async fn test_error_codes() { .send() .await .unwrap(); - assert_eq!(res.status(), 400); + assert_eq!(res.status(), StatusCode::BAD_REQUEST); // Poll with invalid causality token: 400 let res = ctx @@ -137,5 +137,5 @@ async fn test_error_codes() { .send() .await .unwrap(); - assert_eq!(res.status(), 400); + assert_eq!(res.status(), StatusCode::BAD_REQUEST); } |