Skip to content

Commit

Permalink
use an other domain to make the tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
bchamagne committed Jan 16, 2024
1 parent eae08a2 commit 8414c38
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ defmodule Archethic.Contracts.Interpreter.Library.Common.HttpImplTest do
# ----------------------------------------
describe "request/4 common behavior" do
test "should raise if domain does not exist" do
assert_raise Library.Error, fn -> HttpImpl.request("https://localhost.local", "GET") end
assert_raise Library.Error, fn -> HttpImpl.request("https://non-existing.domain", "GET") end
end

test "should return a 404 if page does not exist" do
Expand Down Expand Up @@ -131,9 +131,9 @@ defmodule Archethic.Contracts.Interpreter.Library.Common.HttpImplTest do
HttpImpl.request("https://127.0.0.1:8081", "GET", %{}, nil, false)
end

test "should return a -4001 if the domain is inexistant" do
assert %{"status" => -4001} =
HttpImpl.request("https://localhost.local", "GET", %{}, nil, false)
test "should return a -4000 if the domain is inexistant" do
assert %{"status" => -4000} =
HttpImpl.request("https://non-existing.domain", "GET", %{}, nil, false)
end
end

Expand Down Expand Up @@ -177,7 +177,7 @@ defmodule Archethic.Contracts.Interpreter.Library.Common.HttpImplTest do
assert_raise Library.Error, fn ->
HttpImpl.request_many([
%{"url" => "https://127.0.0.1:8081", "method" => "GET"},
%{"url" => "https://localhost.local", "method" => "GET"}
%{"url" => "https://non-existing.domain", "method" => "GET"}
])
end

Expand Down Expand Up @@ -304,12 +304,12 @@ defmodule Archethic.Contracts.Interpreter.Library.Common.HttpImplTest do
)
end

test "should return a -4001 if the domain is inexistant" do
assert [%{"status" => 200}, %{"status" => -4001}] =
test "should return a -4000 if the domain is inexistant" do
assert [%{"status" => 200}, %{"status" => -4000}] =
HttpImpl.request_many(
[
%{"url" => "https://127.0.0.1:8081", "method" => "GET"},
%{"url" => "https://localhost.local", "method" => "GET"}
%{"url" => "https://non-existing.domain", "method" => "GET"}
],
false
)
Expand Down

0 comments on commit 8414c38

Please sign in to comment.