Use a testserver in tests. (#194)

This is a step towards allowing our tests to run without network access,
which will make them more resilient and faster.

Replace the URL in one instance of an HTTPS test that didn't need HTTPS.
This commit is contained in:
Jacob Hoffman-Andrews
2020-10-19 00:27:40 -07:00
committed by GitHub
parent 6e997909bf
commit 75bc803cf1
5 changed files with 62 additions and 9 deletions

View File

@@ -136,7 +136,10 @@ pub use serde_json::{to_value as serde_to_value, Map as SerdeMap, Value as Serde
/// Agents are used to keep state between requests.
pub fn agent() -> Agent {
Agent::default()
#[cfg(not(test))]
return Agent::default();
#[cfg(test)]
return test::test_agent();
}
/// Make a request setting the HTTP method via a string.