summaryrefslogtreecommitdiff
path: root/cli/http_util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/http_util.rs')
-rw-r--r--cli/http_util.rs4
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]