diff options
author | lain <lain@soykaf.club> | 2019-02-01 10:21:17 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-02-01 10:21:17 +0100 |
commit | 01d483f9c76456ed03010f5a0f5e08e118db27a8 (patch) | |
tree | f3d0ca4e15c951d38e44e85befd366f1a8eca0f9 /test/support/http_request_mock.ex | |
parent | b19b4f85376f6bad33bb37b1624f45dbd502bfda (diff) | |
parent | b3b0855456a92351667a50c8ea77f328bded76ca (diff) | |
download | pleroma-01d483f9c76456ed03010f5a0f5e08e118db27a8.tar.gz pleroma-01d483f9c76456ed03010f5a0f5e08e118db27a8.zip |
Merge remote-tracking branch 'origin/develop' into fix-rich-media-toggle
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 |