}}
end
+ def get("https://mastodon.sdf.org/users/rinpatch/collections/featured", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body:
+ File.read!("test/fixtures/users_mock/masto_featured.json")
+ |> String.replace("{{domain}}", "mastodon.sdf.org")
+ |> String.replace("{{nickname}}", "rinpatch"),
+ headers: [{"content-type", "application/activity+json"}]
+ }}
+ end
+
def get("https://patch.cx/objects/tesla_mock/poll_attachment", _, _, _) do
{:ok,
%Tesla.Env{
}}
end
+ def get("https://mastodon.social/users/lambadalambda/collections/featured", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body:
+ File.read!("test/fixtures/users_mock/masto_featured.json")
+ |> String.replace("{{domain}}", "mastodon.social")
+ |> String.replace("{{nickname}}", "lambadalambda"),
+ headers: activitypub_object_headers()
+ }}
+ end
+
def get("https://apfed.club/channel/indio", _, _, _) do
{:ok,
%Tesla.Env{
def get(url, query, body, headers) do
{:error,
- "Mock response not implemented for GET #{inspect(url)}, #{query}, #{inspect(body)}, #{
- inspect(headers)
- }"}
+ "Mock response not implemented for GET #{inspect(url)}, #{query}, #{inspect(body)}, #{inspect(headers)}"}
end
# POST Requests
def post(url, query, body, headers) do
{:error,
- "Mock response not implemented for POST #{inspect(url)}, #{query}, #{inspect(body)}, #{
- inspect(headers)
- }"}
+ "Mock response not implemented for POST #{inspect(url)}, #{query}, #{inspect(body)}, #{inspect(headers)}"}
end
# Most of the rich media mocks are missing HEAD requests, so we just return 404.
def head(url, query, body, headers) do
{:error,
- "Mock response not implemented for HEAD #{inspect(url)}, #{query}, #{inspect(body)}, #{
- inspect(headers)
- }"}
+ "Mock response not implemented for HEAD #{inspect(url)}, #{query}, #{inspect(body)}, #{inspect(headers)}"}
end
end