summaryrefslogtreecommitdiff
path: root/test/support
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2019-11-04 20:24:53 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2019-11-04 20:24:53 +0300
commitff6c727739484df31335d2675fbd2446cc5435e1 (patch)
tree165d76253331566af22476d80dd44b7e2bb6013d /test/support
parent57995fa8cf26c9d5cd31969b59dbafb9f8c8fdc7 (diff)
parentfee127696308dbec9cff6b2a9b399cf2877cf445 (diff)
downloadpleroma-ff6c727739484df31335d2675fbd2446cc5435e1.tar.gz
pleroma-ff6c727739484df31335d2675fbd2446cc5435e1.zip
Merge branch 'develop' into issue/1276
Diffstat (limited to 'test/support')
-rw-r--r--test/support/http_request_mock.ex28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex
index eba22c40b..965335e96 100644
--- a/test/support/http_request_mock.ex
+++ b/test/support/http_request_mock.ex
@@ -1183,6 +1183,30 @@ defmodule HttpRequestMock do
}}
end
+ def get("https://10.111.10.1/notice/9kCP7V", _, _, _) do
+ {:ok, %Tesla.Env{status: 200, body: ""}}
+ end
+
+ def get("https://172.16.32.40/notice/9kCP7V", _, _, _) do
+ {:ok, %Tesla.Env{status: 200, body: ""}}
+ end
+
+ def get("https://192.168.10.40/notice/9kCP7V", _, _, _) do
+ {:ok, %Tesla.Env{status: 200, body: ""}}
+ end
+
+ def get("https://www.patreon.com/posts/mastodon-2-9-and-28121681", _, _, _) do
+ {:ok, %Tesla.Env{status: 200, body: ""}}
+ end
+
+ def get("http://mastodon.example.org/@admin/99541947525187367", _, _, _) do
+ {:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/mastodon-post-activity.json")}}
+ end
+
+ def get("https://info.pleroma.site/activity4.json", _, _, _) do
+ {:ok, %Tesla.Env{status: 500, body: "Error occurred"}}
+ end
+
def get("http://example.com/rel_me/anchor", _, _, _) do
{:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/rel_me_anchor.html")}}
end
@@ -1215,6 +1239,10 @@ defmodule HttpRequestMock do
{:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/rin.json")}}
end
+ def get("http://example.com/rel_me/error", _, _, _) do
+ {:ok, %Tesla.Env{status: 404, body: ""}}
+ end
+
def get(url, query, body, headers) do
{:error,
"Mock response not implemented for GET #{inspect(url)}, #{query}, #{inspect(body)}, #{