chore: move test files to testdata directory (#11601)

This commit is contained in:
David Sherret 2021-08-11 10:20:47 -04:00 committed by GitHub
parent a0285e2eb8
commit 15a763152f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1089 changed files with 1150 additions and 1160 deletions

View file

@ -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(),
)