diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-11-14 18:37:38 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-11-14 18:37:38 -0800 |
commit | 610b0a6550c758529cf6c34587f45e483a240df4 (patch) | |
tree | 53b84dc464119841dcf659674f048173492c9800 /rust/tests/helpers.rs | |
parent | cb8067ca6e4abe3bea499fc45ece05a454c794d6 (diff) | |
download | fatcat-610b0a6550c758529cf6c34587f45e483a240df4.tar.gz fatcat-610b0a6550c758529cf6c34587f45e483a240df4.zip |
rustfmt
Diffstat (limited to 'rust/tests/helpers.rs')
-rw-r--r-- | rust/tests/helpers.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/rust/tests/helpers.rs b/rust/tests/helpers.rs index a5685614..5e182508 100644 --- a/rust/tests/helpers.rs +++ b/rust/tests/helpers.rs @@ -1,26 +1,22 @@ - extern crate diesel; extern crate fatcat; extern crate fatcat_api_spec; -extern crate uuid; extern crate iron; extern crate iron_test; +extern crate uuid; -use std::{thread, time}; use self::iron_test::response; -use iron::{status, Iron, Listening, Headers}; +use fatcat_api_spec::client::Client; use iron::headers::ContentType; use iron::mime::Mime; -use fatcat_api_spec::client::Client; +use iron::{status, Headers, Iron, Listening}; +use std::{thread, time}; // A current problem with this method is that if the test fails (eg, panics, assert fails), the // server never gets closed, and the server thread hangs forever. // One workaround might be to invert the function, take a closure, capture the panic/failure, and // cleanup. -pub fn setup_client() -> ( - Client, - Listening, -) { +pub fn setup_client() -> (Client, Listening) { let server = fatcat::test_server().unwrap(); let router = fatcat_api_spec::router(server); // this is an unfortunate hack for testings seeming to fail in CI |