change Builders to only error at the end

Closes #189
This commit is contained in:
Sean McArthur
2017-08-31 11:45:24 -07:00
parent a02b388b2b
commit 779f8080ef
16 changed files with 390 additions and 313 deletions

View File

@@ -30,12 +30,10 @@ fn test_write_timeout() {
let url = format!("http://{}/write-timeout", server.addr());
let err = reqwest::Client::builder()
.unwrap()
.timeout(Duration::from_millis(500))
.build()
.unwrap()
.post(&url)
.unwrap()
.header(reqwest::header::ContentLength(5))
.body(reqwest::Body::new(&b"Hello"[..]))
.send()
@@ -66,12 +64,10 @@ fn test_response_timeout() {
let url = format!("http://{}/response-timeout", server.addr());
let err = reqwest::Client::builder()
.unwrap()
.timeout(Duration::from_millis(500))
.build()
.unwrap()
.get(&url)
.unwrap()
.send()
.unwrap_err();
@@ -101,12 +97,10 @@ fn test_read_timeout() {
let url = format!("http://{}/read-timeout", server.addr());
let mut res = reqwest::Client::builder()
.unwrap()
.timeout(Duration::from_millis(500))
.build()
.unwrap()
.get(&url)
.unwrap()
.send()
.unwrap();