X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Fsupport%2Fhttp_request_mock.ex;h=e72638814804b765b48763417eaeaaf0cffe477c;hb=9cf4c4fa73e68f03791c5cc70505b710be39b677;hp=ba33413271277862951af05391008094896e83e9;hpb=21a2a054070c26d7be1a0e453e5f40b20fbd59f2;p=akkoma
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex
index ba3341327..e72638814 100644
--- a/test/support/http_request_mock.ex
+++ b/test/support/http_request_mock.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule HttpRequestMock do
@@ -1277,6 +1277,10 @@ defmodule HttpRequestMock do
{:ok, %Tesla.Env{status: 404, body: ""}}
end
+ def get("https://relay.mastodon.host/actor", _, _, _) do
+ {:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/relay/relay.json")}}
+ end
+
def get(url, query, body, headers) do
{:error,
"Mock response not implemented for GET #{inspect(url)}, #{query}, #{inspect(body)}, #{
@@ -1289,6 +1293,10 @@ defmodule HttpRequestMock do
def post(url, query \\ [], body \\ [], headers \\ [])
+ def post("https://relay.mastodon.host/inbox", _, _, _) do
+ {:ok, %Tesla.Env{status: 200, body: ""}}
+ end
+
def post("http://example.org/needs_refresh", _, _, _) do
{:ok,
%Tesla.Env{