aboutsummaryrefslogtreecommitdiff
path: root/src/garage/tests/k2v/poll.rs
diff options
context:
space:
mode:
authorTobias Krischer <tobias.krischer@elyxon.de>2022-10-16 19:46:15 +0200
committerTobias Krischer <tobias.krischer@elyxon.de>2022-10-17 10:55:26 +0200
commit786500332341c8e39f7e3e82e493e567ecaa70e4 (patch)
tree805e6ca8d90d177410d1610f9086bab7194f8e6e /src/garage/tests/k2v/poll.rs
parent4582a8f34aba85ff7b0a56935f27cc166819dec1 (diff)
downloadgarage-786500332341c8e39f7e3e82e493e567ecaa70e4.tar.gz
garage-786500332341c8e39f7e3e82e493e567ecaa70e4.zip
Use status code 204 No Content for empty responses
Diffstat (limited to 'src/garage/tests/k2v/poll.rs')
-rw-r--r--src/garage/tests/k2v/poll.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/garage/tests/k2v/poll.rs b/src/garage/tests/k2v/poll.rs
index 70dc0410..e56705ae 100644
--- a/src/garage/tests/k2v/poll.rs
+++ b/src/garage/tests/k2v/poll.rs
@@ -1,4 +1,4 @@
-use hyper::Method;
+use hyper::{Method, StatusCode};
use std::time::Duration;
use crate::common;
@@ -20,7 +20,7 @@ async fn test_poll() {
.send()
.await
.unwrap();
- assert_eq!(res.status(), 200);
+ assert_eq!(res.status(), StatusCode::NO_CONTENT);
// Retrieve initial value to get its causality token
let res2 = ctx
@@ -33,7 +33,7 @@ async fn test_poll() {
.send()
.await
.unwrap();
- assert_eq!(res2.status(), 200);
+ assert_eq!(res2.status(), StatusCode::OK);
let ct = res2
.headers()
.get("x-garage-causality-token")
@@ -80,7 +80,7 @@ async fn test_poll() {
.send()
.await
.unwrap();
- assert_eq!(res.status(), 200);
+ assert_eq!(res.status(), StatusCode::NO_CONTENT);
// Check poll finishes with correct value
let poll_res = tokio::select! {
@@ -88,7 +88,7 @@ async fn test_poll() {
res = poll => res.unwrap().unwrap(),
};
- assert_eq!(poll_res.status(), 200);
+ assert_eq!(poll_res.status(), StatusCode::OK);
let poll_res_body = hyper::body::to_bytes(poll_res.into_body())
.await