summaryrefslogtreecommitdiff
path: root/test/support/http_request_mock.ex
diff options
context:
space:
mode:
authortusooa <tusooa@kazv.moe>2022-09-05 15:00:19 +0000
committertusooa <tusooa@kazv.moe>2022-09-05 15:00:19 +0000
commit9874b4c985ea715a37cf2d2a5c8db2fb26e28f3a (patch)
treee495f10d3cac124d405cfe01015821a930f3a1df /test/support/http_request_mock.ex
parente06f2b9f5ea58c90cafd7864a66809fe8ea0a96f (diff)
parentf8afba95b20670b5d6e93896ccd27bb3fca003a2 (diff)
downloadpleroma-9874b4c985ea715a37cf2d2a5c8db2fb26e28f3a.tar.gz
pleroma-9874b4c985ea715a37cf2d2a5c8db2fb26e28f3a.zip
Merge branch 'develop' into 'from/upstream-develop/tusooa/2892-backup-scope'
# Conflicts: # CHANGELOG.md
Diffstat (limited to 'test/support/http_request_mock.ex')
-rw-r--r--test/support/http_request_mock.ex53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex
index eb844e469..7f6065579 100644
--- a/test/support/http_request_mock.ex
+++ b/test/support/http_request_mock.ex
@@ -1084,6 +1084,14 @@ defmodule HttpRequestMock do
}}
end
+ def get("https://404.site" <> _, _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 404,
+ body: ""
+ }}
+ end
+
def get(
"https://zetsubou.xn--q9jyb4c/.well-known/webfinger?resource=acct:lain@zetsubou.xn--q9jyb4c",
_,
@@ -1401,6 +1409,51 @@ defmodule HttpRequestMock do
}}
end
+ def get("https://mk.absturztau.be/users/8ozbzjs3o8", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/tesla_mock/mametsuko@mk.absturztau.be.json"),
+ headers: activitypub_object_headers()
+ }}
+ end
+
+ def get("https://p.helene.moe/users/helene", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/tesla_mock/helene@p.helene.moe.json"),
+ headers: activitypub_object_headers()
+ }}
+ end
+
+ def get("https://mk.absturztau.be/notes/93e7nm8wqg", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/tesla_mock/mk.absturztau.be-93e7nm8wqg.json"),
+ headers: activitypub_object_headers()
+ }}
+ end
+
+ def get("https://mk.absturztau.be/notes/93e7nm8wqg/activity", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/tesla_mock/mk.absturztau.be-93e7nm8wqg-activity.json"),
+ headers: activitypub_object_headers()
+ }}
+ end
+
+ def get("https://p.helene.moe/objects/fd5910ac-d9dc-412e-8d1d-914b203296c4", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/tesla_mock/p.helene.moe-AM7S6vZQmL6pI9TgPY.json"),
+ headers: activitypub_object_headers()
+ }}
+ end
+
def get(url, query, body, headers) do
{:error,
"Mock response not implemented for GET #{inspect(url)}, #{query}, #{inspect(body)}, #{inspect(headers)}"}