diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-09-19 14:48:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-19 14:48:05 -0400 |
commit | 56ac638d93c96712d6c624e60dcfa4540d334b18 (patch) | |
tree | b3b5b985cc5be83545d8883207ee614f23627ef8 /cli/http_util.rs | |
parent | 1b1ae65a4a2acd55ead86c17e388f10a0e08938d (diff) |
Remove test.py, use cargo test as test frontend (#2967)
Fixes #2933
Diffstat (limited to 'cli/http_util.rs')
-rw-r--r-- | cli/http_util.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/http_util.rs b/cli/http_util.rs index 6411a9ad6..abeeffb7a 100644 --- a/cli/http_util.rs +++ b/cli/http_util.rs @@ -145,6 +145,7 @@ mod tests { #[test] fn test_fetch_sync_string() { + let http_server_guard = crate::test_util::http_server(); // Relies on external http server. See tools/http_server.py let url = Url::parse("http://127.0.0.1:4545/package.json").unwrap(); tokio_util::init(|| match fetch_string_once_sync(&url).unwrap() { @@ -154,10 +155,12 @@ mod tests { } _ => unreachable!(), }); + drop(http_server_guard); } #[test] fn test_fetch_string_once_with_redirect() { + let http_server_guard = crate::test_util::http_server(); // Relies on external http server. See tools/http_server.py let url = Url::parse("http://127.0.0.1:4546/package.json").unwrap(); // Dns resolver substitutes `127.0.0.1` with `localhost` @@ -166,6 +169,7 @@ mod tests { let result = fetch_string_once_sync(&url).unwrap(); assert_eq!(result, FetchOnceResult::Redirect(target_url)); }); + drop(http_server_guard); } #[test] |