diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2020-07-20 21:54:25 +0000 |
---|---|---|
committer | Sven-Hendrik Haase <svenstaro@gmail.com> | 2020-07-20 21:54:25 +0000 |
commit | b17a29472f3c418f097774fc61420a8e54de8ad1 (patch) | |
tree | fa4f927f2390a505297ceafd7e29f759bbdba86d /tests | |
parent | Change CHANGELOG.md format to keepachangelog.com (diff) | |
download | miniserve-b17a29472f3c418f097774fc61420a8e54de8ad1.tar.gz miniserve-b17a29472f3c418f097774fc61420a8e54de8ad1.zip |
cargo fmt
Diffstat (limited to 'tests')
-rw-r--r-- | tests/qrcode.rs | 8 | ||||
-rw-r--r-- | tests/serve_request.rs | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/qrcode.rs b/tests/qrcode.rs index b032267..ca98861 100644 --- a/tests/qrcode.rs +++ b/tests/qrcode.rs @@ -57,7 +57,6 @@ fn show_qrcode_element(tmpdir: TempDir, port: u16) -> Result<(), Error> { #[rstest] fn get_svg_qrcode(tmpdir: TempDir, port: u16) -> Result<(), Error> { - let mut child = Command::cargo_bin("miniserve")? .arg(tmpdir.path()) .arg("-p") @@ -69,7 +68,7 @@ fn get_svg_qrcode(tmpdir: TempDir, port: u16) -> Result<(), Error> { // Ok let resp = reqwest::blocking::get(format!("http://localhost:{}/?qrcode=test", port).as_str())?; - + assert_eq!(resp.status(), StatusCode::OK); assert_eq!(resp.headers()["Content-Type"], "image/svg+xml"); let body = resp.text()?; @@ -78,8 +77,9 @@ fn get_svg_qrcode(tmpdir: TempDir, port: u16) -> Result<(), Error> { // Err let content: String = repeat_with(|| '0').take(8 * 1024).collect(); - let resp = reqwest::blocking::get(format!("http://localhost:{}/?qrcode={}", port, content).as_str())?; - + let resp = + reqwest::blocking::get(format!("http://localhost:{}/?qrcode={}", port, content).as_str())?; + assert_eq!(resp.status(), StatusCode::URI_TOO_LONG); child.kill()?; diff --git a/tests/serve_request.rs b/tests/serve_request.rs index ad9dc2c..cc0e059 100644 --- a/tests/serve_request.rs +++ b/tests/serve_request.rs @@ -3,13 +3,13 @@ mod fixtures; use assert_cmd::prelude::*; use assert_fs::fixture::TempDir; use fixtures::{port, tmpdir, Error, DIRECTORIES, FILES}; +use regex::Regex; use rstest::rstest; use select::document::Document; use select::node::Node; use std::process::{Command, Stdio}; use std::thread::sleep; use std::time::Duration; -use regex::Regex; #[rstest] fn serves_requests_with_no_options(tmpdir: TempDir) -> Result<(), Error> { |