Fetch tests (first batch) (#3977)

* Customizable fetch

* Some basic Fetch tests
This commit is contained in:
Tomasz Drwięga
2016-12-27 16:38:55 +01:00
committed by Gav Wood
parent a95057abe1
commit bc3dacc952
11 changed files with 440 additions and 85 deletions

View File

@@ -27,6 +27,16 @@ pub struct Response {
pub body: String,
}
impl Response {
pub fn assert_status(&self, status: &str) {
assert_eq!(self.status, status.to_owned(), "Got unexpected code. Body: {:?}", self.body);
}
pub fn assert_security_headers_present(&self, port: Option<u16>) {
assert_security_headers_present(&self.headers, port)
}
}
pub fn read_block(lines: &mut Lines, all: bool) -> String {
let mut block = String::new();
loop {