HttpRequestMock: Add 404s on OStatus fetching for info.pleroma.site

This commit is contained in:
Haelwenn (lanodan) Monnier 2019-07-14 13:39:05 +02:00
parent efa9a13d4e
commit f00562ed6b
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
1 changed files with 12 additions and 0 deletions

View File

@ -887,6 +887,10 @@ def get("https://info.pleroma.site/activity.json", _, _, Accept: "application/ac
}} }}
end end
def get("https://info.pleroma.site/activity.json", _, _, _) do
{:ok, %Tesla.Env{status: 404, body: ""}}
end
def get("https://info.pleroma.site/activity2.json", _, _, Accept: "application/activity+json") do def get("https://info.pleroma.site/activity2.json", _, _, Accept: "application/activity+json") do
{:ok, {:ok,
%Tesla.Env{ %Tesla.Env{
@ -895,6 +899,10 @@ def get("https://info.pleroma.site/activity2.json", _, _, Accept: "application/a
}} }}
end end
def get("https://info.pleroma.site/activity2.json", _, _, _) do
{:ok, %Tesla.Env{status: 404, body: ""}}
end
def get("https://info.pleroma.site/activity3.json", _, _, Accept: "application/activity+json") do def get("https://info.pleroma.site/activity3.json", _, _, Accept: "application/activity+json") do
{:ok, {:ok,
%Tesla.Env{ %Tesla.Env{
@ -903,6 +911,10 @@ def get("https://info.pleroma.site/activity3.json", _, _, Accept: "application/a
}} }}
end end
def get("https://info.pleroma.site/activity3.json", _, _, _) do
{:ok, %Tesla.Env{status: 404, body: ""}}
end
def get(url, query, body, headers) do def get(url, query, body, headers) do
{:error, {:error,
"Not implemented the mock response for get #{inspect(url)}, #{query}, #{inspect(body)}, #{ "Not implemented the mock response for get #{inspect(url)}, #{query}, #{inspect(body)}, #{