diff options
author | href <href+git-pleroma@random.sh> | 2019-02-01 09:14:35 +0000 |
---|---|---|
committer | href <href+git-pleroma@random.sh> | 2019-02-01 09:14:35 +0000 |
commit | b3b0855456a92351667a50c8ea77f328bded76ca (patch) | |
tree | 329d20c3eb8279caf01e0fb1ffbb0d08ae406f87 /test/support/http_request_mock.ex | |
parent | 0340fcaecadae858b9c8fe39cc18bc25aef3e495 (diff) | |
parent | 92753b0cd9cfcdc5edb64a5e55ad27f73079f9e0 (diff) | |
download | pleroma-b3b0855456a92351667a50c8ea77f328bded76ca.tar.gz pleroma-b3b0855456a92351667a50c8ea77f328bded76ca.zip |
Merge branch '534_federation_targets_reachability' into 'develop'
[#534] Unreachable federation targets retirement
Closes #534
See merge request pleroma/pleroma!703
Diffstat (limited to 'test/support/http_request_mock.ex')
-rw-r--r-- | test/support/http_request_mock.ex | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex index c60f61873..78e8efc9d 100644 --- a/test/support/http_request_mock.ex +++ b/test/support/http_request_mock.ex @@ -696,6 +696,14 @@ defmodule HttpRequestMock do {:ok, %Tesla.Env{status: 200, body: "hello"}} end + def get("http://404.site" <> _, _, _, _) do + {:ok, + %Tesla.Env{ + status: 404, + body: "" + }} + end + def get(url, query, body, headers) do {:error, "Not implemented the mock response for get #{inspect(url)}, #{query}, #{inspect(body)}, #{ @@ -716,6 +724,26 @@ defmodule HttpRequestMock do }} end + def post("http://200.site" <> _, _, _, _) do + {:ok, + %Tesla.Env{ + status: 200, + body: "" + }} + end + + def post("http://connrefused.site" <> _, _, _, _) do + {:error, :connrefused} + end + + def post("http://404.site" <> _, _, _, _) do + {:ok, + %Tesla.Env{ + status: 404, + body: "" + }} + end + def post(url, _query, _body, _headers) do {:error, "Not implemented the mock response for post #{inspect(url)}"} end |