resp.status() return u16

This commit is contained in:
Martin Algesten
2018-07-01 09:04:50 +02:00
parent 4dc47958c6
commit 567a19a656
4 changed files with 14 additions and 14 deletions

View File

@@ -14,7 +14,7 @@ fn basic_auth() {
let resp = get("test://host/basic_auth")
.auth("martin", "rubbermashgum")
.call();
assert_eq!(*resp.status(), 200);
assert_eq!(resp.status(), 200);
}
#[test]
@@ -26,5 +26,5 @@ fn kind_auth() {
let resp = get("test://host/kind_auth")
.auth_kind("Digest", "abcdefgh123")
.call();
assert_eq!(*resp.status(), 200);
assert_eq!(resp.status(), 200);
}

View File

@@ -7,7 +7,7 @@ fn read_range() {
let resp = get("https://s3.amazonaws.com/foosrvr/bbb.mp4")
.set("Range", "bytes=1000-1999")
.call();
assert_eq!(*resp.status(), 206);
assert_eq!(resp.status(), 206);
let mut reader = resp.into_reader();
let mut buf = vec![];
let len = reader.read_to_end(&mut buf).unwrap();
@@ -26,7 +26,7 @@ fn agent_pool() {
let resp = agent.get("https://s3.amazonaws.com/foosrvr/bbb.mp4")
.set("Range", "bytes=1000-1999")
.call();
assert_eq!(*resp.status(), 206);
assert_eq!(resp.status(), 206);
let mut reader = resp.into_reader();
let mut buf = vec![];
// reading the entire content will return the connection to the pool
@@ -46,7 +46,7 @@ fn agent_pool() {
let resp = agent.get("https://s3.amazonaws.com/foosrvr/bbb.mp4")
.set("Range", "bytes=5000-6999")
.call();
assert_eq!(*resp.status(), 206);
assert_eq!(resp.status(), 206);
let mut reader = resp.into_reader();
let mut buf = vec![];
let len = reader.read_to_end(&mut buf).unwrap();

View File

@@ -11,7 +11,7 @@ fn header_passing() {
test::make_response(200, "OK", vec!["X-Bar: foo"], vec![])
});
let resp = get("test://host/header_passing").set("X-Foo", "bar").call();
assert_eq!(*resp.status(), 200);
assert_eq!(resp.status(), 200);
assert!(resp.has("X-Bar"));
assert_eq!(resp.header("X-Bar").unwrap(), "foo");
}
@@ -27,7 +27,7 @@ fn repeat_non_x_header() {
.set("Accept", "bar")
.set("Accept", "baz")
.call();
assert_eq!(*resp.status(), 200);
assert_eq!(resp.status(), 200);
}
#[test]
@@ -45,7 +45,7 @@ fn repeat_x_header() {
.set("X-Forwarded-For", "130.240.19.2")
.set("X-Forwarded-For", "130.240.19.3")
.call();
assert_eq!(*resp.status(), 200);
assert_eq!(resp.status(), 200);
}
#[test]