Skip to content

Commit

Permalink
Add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Nov 2, 2023
1 parent 39c9f2e commit 2cf3790
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ic-agent/src/agent/http_transport/reqwest_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,36 @@ mod test {
test("https://foo.bar.ic0.app", "https://ic0.app/api/v2/");
test("https://ic0.app/foo/", "https://ic0.app/foo/api/v2/");
test("https://foo.ic0.app/foo/", "https://ic0.app/foo/api/v2/");
test(
"https://ryjl3-tyaaa-aaaaa-aaaba-cai.ic0.app",
"https://ic0.app/api/v2/",
);

test("https://ic1.app", "https://ic1.app/api/v2/");
test("https://foo.ic1.app", "https://foo.ic1.app/api/v2/");
test("https://ic0.app.ic1.app", "https://ic0.app.ic1.app/api/v2/");

test("https://fooic0.app", "https://fooic0.app/api/v2/");
test("https://fooic0.app.ic0.app", "https://ic0.app/api/v2/");

test("https://icp0.io", "https://icp0.io/api/v2/");
test(
"https://ryjl3-tyaaa-aaaaa-aaaba-cai.icp0.io",
"https://icp0.io/api/v2/",
);
test("https://ic0.app.icp0.io", "https://icp0.io/api/v2/");

test("https://icp-api.io", "https://icp-api.io/api/v2/");
test(
"https://ryjl3-tyaaa-aaaaa-aaaba-cai.icp-api.io",
"https://icp-api.io/api/v2/",
);
test("https://icp0.io.icp-api.io", "https://icp-api.io/api/v2/");

test("http://localhost:4943", "http://localhost:4943/api/v2/");
test(
"http://ryjl3-tyaaa-aaaaa-aaaba-cai.localhost:4943",
"https://localhost:4943/api/v2",
);
}
}

0 comments on commit 2cf3790

Please sign in to comment.