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.rs54
1 files changed, 22 insertions, 32 deletions
diff --git a/cli/http_util.rs b/cli/http_util.rs
index 89ba4fb93..46ec73cc7 100644
--- a/cli/http_util.rs
+++ b/cli/http_util.rs
@@ -152,8 +152,7 @@ mod tests {
async fn test_fetch_string() {
let _http_server_guard = test_util::http_server();
// Relies on external http server. See target/debug/test_server
- let url =
- Url::parse("http://127.0.0.1:4545/cli/tests/fixture.json").unwrap();
+ let url = Url::parse("http://127.0.0.1:4545/fixture.json").unwrap();
let client = create_test_client(None);
let result = fetch_once(FetchOnceArgs {
client,
@@ -176,10 +175,8 @@ mod tests {
async fn test_fetch_gzip() {
let _http_server_guard = test_util::http_server();
// Relies on external http server. See target/debug/test_server
- let url = Url::parse(
- "http://127.0.0.1:4545/cli/tests/053_import_compression/gziped",
- )
- .unwrap();
+ let url = Url::parse("http://127.0.0.1:4545/053_import_compression/gziped")
+ .unwrap();
let client = create_test_client(None);
let result = fetch_once(FetchOnceArgs {
client,
@@ -239,10 +236,8 @@ mod tests {
async fn test_fetch_brotli() {
let _http_server_guard = test_util::http_server();
// Relies on external http server. See target/debug/test_server
- let url = Url::parse(
- "http://127.0.0.1:4545/cli/tests/053_import_compression/brotli",
- )
- .unwrap();
+ let url = Url::parse("http://127.0.0.1:4545/053_import_compression/brotli")
+ .unwrap();
let client = create_test_client(None);
let result = fetch_once(FetchOnceArgs {
client,
@@ -269,11 +264,9 @@ mod tests {
async fn test_fetch_once_with_redirect() {
let _http_server_guard = test_util::http_server();
// Relies on external http server. See target/debug/test_server
- let url =
- Url::parse("http://127.0.0.1:4546/cli/tests/fixture.json").unwrap();
+ let url = Url::parse("http://127.0.0.1:4546/fixture.json").unwrap();
// Dns resolver substitutes `127.0.0.1` with `localhost`
- let target_url =
- Url::parse("http://localhost:4545/cli/tests/fixture.json").unwrap();
+ let target_url = Url::parse("http://localhost:4545/fixture.json").unwrap();
let client = create_test_client(None);
let result = fetch_once(FetchOnceArgs {
client,
@@ -331,16 +324,15 @@ mod tests {
async fn test_fetch_with_cafile_string() {
let _http_server_guard = test_util::http_server();
// Relies on external http server. See target/debug/test_server
- let url =
- Url::parse("https://localhost:5545/cli/tests/fixture.json").unwrap();
+ let url = Url::parse("https://localhost:5545/fixture.json").unwrap();
let client = create_http_client(
version::get_user_agent(),
None,
Some(
read(
- test_util::root_path()
- .join("cli/tests/tls/RootCA.pem")
+ test_util::testdata_path()
+ .join("tls/RootCA.pem")
.to_str()
.unwrap(),
)
@@ -431,17 +423,16 @@ mod tests {
async fn test_fetch_with_cafile_gzip() {
let _http_server_guard = test_util::http_server();
// Relies on external http server. See target/debug/test_server
- let url = Url::parse(
- "https://localhost:5545/cli/tests/053_import_compression/gziped",
- )
- .unwrap();
+ let url =
+ Url::parse("https://localhost:5545/053_import_compression/gziped")
+ .unwrap();
let client = create_http_client(
version::get_user_agent(),
None,
Some(
read(
- test_util::root_path()
- .join("cli/tests/tls/RootCA.pem")
+ test_util::testdata_path()
+ .join("tls/RootCA.pem")
.to_str()
.unwrap(),
)
@@ -480,8 +471,8 @@ mod tests {
None,
Some(
read(
- test_util::root_path()
- .join("cli/tests/tls/RootCA.pem")
+ test_util::testdata_path()
+ .join("tls/RootCA.pem")
.to_str()
.unwrap(),
)
@@ -525,17 +516,16 @@ mod tests {
async fn test_fetch_with_cafile_brotli() {
let _http_server_guard = test_util::http_server();
// Relies on external http server. See target/debug/test_server
- let url = Url::parse(
- "https://localhost:5545/cli/tests/053_import_compression/brotli",
- )
- .unwrap();
+ let url =
+ Url::parse("https://localhost:5545/053_import_compression/brotli")
+ .unwrap();
let client = create_http_client(
version::get_user_agent(),
None,
Some(
read(
- test_util::root_path()
- .join("cli/tests/tls/RootCA.pem")
+ test_util::testdata_path()
+ .join("tls/RootCA.pem")
.to_str()
.unwrap(),
)