Merge develop
[akkoma] / test / support / http_request_mock.ex
index 231e7c49839d3b372c543dc47da18c4b8f9ad62c..344e27f137506a8fb65f43789b5df98a65c243ca 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule HttpRequestMock do
@@ -19,7 +19,7 @@ defmodule HttpRequestMock do
     else
       error ->
         with {:error, message} <- error do
-          Logger.warn(message)
+          Logger.warn(to_string(message))
         end
 
         {_, _r} = error
@@ -38,6 +38,14 @@ defmodule HttpRequestMock do
      }}
   end
 
+  def get("https://shitposter.club/users/moonman", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/moonman@shitposter.club.json")
+     }}
+  end
+
   def get("https://mastodon.social/users/emelie/statuses/101849165031453009", _, _, _) do
     {:ok,
      %Tesla.Env{
@@ -46,6 +54,14 @@ defmodule HttpRequestMock do
      }}
   end
 
+  def get("https://mastodon.social/users/emelie/statuses/101849165031453404", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 404,
+       body: ""
+     }}
+  end
+
   def get("https://mastodon.social/users/emelie", _, _, _) do
     {:ok,
      %Tesla.Env{
@@ -66,6 +82,14 @@ defmodule HttpRequestMock do
      }}
   end
 
+  def get("https://patch.cx/objects/tesla_mock/poll_attachment", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/poll_attachment.json")
+     }}
+  end
+
   def get(
         "https://mastodon.social/.well-known/webfinger?resource=https://mastodon.social/users/emelie",
         _,
@@ -79,19 +103,11 @@ defmodule HttpRequestMock do
      }}
   end
 
-  def get("https://mastodon.social/users/emelie.atom", _, _, _) do
-    {:ok,
-     %Tesla.Env{
-       status: 200,
-       body: File.read!("test/fixtures/tesla_mock/emelie.atom")
-     }}
-  end
-
   def get(
         "https://osada.macgirvin.com/.well-known/webfinger?resource=acct:mike@osada.macgirvin.com",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -104,7 +120,7 @@ defmodule HttpRequestMock do
         "https://social.heldscal.la/.well-known/webfinger?resource=https://social.heldscal.la/user/29191",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -113,19 +129,11 @@ defmodule HttpRequestMock do
      }}
   end
 
-  def get("https://pawoo.net/users/pekorino.atom", _, _, _) do
-    {:ok,
-     %Tesla.Env{
-       status: 200,
-       body: File.read!("test/fixtures/tesla_mock/https___pawoo.net_users_pekorino.atom")
-     }}
-  end
-
   def get(
         "https://pawoo.net/.well-known/webfinger?resource=acct:https://pawoo.net/users/pekorino",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -134,24 +142,11 @@ defmodule HttpRequestMock do
      }}
   end
 
-  def get(
-        "https://social.stopwatchingus-heidelberg.de/api/statuses/user_timeline/18330.atom",
-        _,
-        _,
-        _
-      ) do
-    {:ok,
-     %Tesla.Env{
-       status: 200,
-       body: File.read!("test/fixtures/tesla_mock/atarifrosch_feed.xml")
-     }}
-  end
-
   def get(
         "https://social.stopwatchingus-heidelberg.de/.well-known/webfinger?resource=acct:https://social.stopwatchingus-heidelberg.de/user/18330",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -160,32 +155,11 @@ defmodule HttpRequestMock do
      }}
   end
 
-  def get("https://mamot.fr/users/Skruyb.atom", _, _, _) do
-    {:ok,
-     %Tesla.Env{
-       status: 200,
-       body: File.read!("test/fixtures/tesla_mock/https___mamot.fr_users_Skruyb.atom")
-     }}
-  end
-
-  def get(
-        "https://mamot.fr/.well-known/webfinger?resource=acct:https://mamot.fr/users/Skruyb",
-        _,
-        _,
-        Accept: "application/xrd+xml,application/jrd+json"
-      ) do
-    {:ok,
-     %Tesla.Env{
-       status: 200,
-       body: File.read!("test/fixtures/tesla_mock/skruyb@mamot.fr.atom")
-     }}
-  end
-
   def get(
         "https://social.heldscal.la/.well-known/webfinger?resource=nonexistant@social.heldscal.la",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -195,10 +169,10 @@ defmodule HttpRequestMock do
   end
 
   def get(
-        "https://squeet.me/xrd/?uri=lain@squeet.me",
+        "https://squeet.me/xrd/?uri=acct:lain@squeet.me",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -211,7 +185,7 @@ defmodule HttpRequestMock do
         "https://mst3k.interlinked.me/users/luciferMysticus",
         _,
         _,
-        Accept: "application/activity+json"
+        [{"accept", "application/activity+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -232,7 +206,7 @@ defmodule HttpRequestMock do
         "https://hubzilla.example.org/channel/kaniini",
         _,
         _,
-        Accept: "application/activity+json"
+        [{"accept", "application/activity+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -241,7 +215,7 @@ defmodule HttpRequestMock do
      }}
   end
 
-  def get("https://niu.moe/users/rye", _, _, Accept: "application/activity+json") do
+  def get("https://niu.moe/users/rye", _, _, [{"accept", "application/activity+json"}]) do
     {:ok,
      %Tesla.Env{
        status: 200,
@@ -249,7 +223,7 @@ defmodule HttpRequestMock do
      }}
   end
 
-  def get("https://n1u.moe/users/rye", _, _, Accept: "application/activity+json") do
+  def get("https://n1u.moe/users/rye", _, _, [{"accept", "application/activity+json"}]) do
     {:ok,
      %Tesla.Env{
        status: 200,
@@ -268,7 +242,7 @@ defmodule HttpRequestMock do
      }}
   end
 
-  def get("https://puckipedia.com/", _, _, Accept: "application/activity+json") do
+  def get("https://puckipedia.com/", _, _, [{"accept", "application/activity+json"}]) do
     {:ok,
      %Tesla.Env{
        status: 200,
@@ -292,6 +266,56 @@ defmodule HttpRequestMock do
      }}
   end
 
+  def get("https://framatube.org/accounts/framasoft", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/https___framatube.org_accounts_framasoft.json")
+     }}
+  end
+
+  def get("https://framatube.org/videos/watch/6050732a-8a7a-43d4-a6cd-809525a1d206", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/framatube.org-video.json")
+     }}
+  end
+
+  def get("https://peertube.social/accounts/craigmaloney", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/craigmaloney.json")
+     }}
+  end
+
+  def get("https://peertube.social/videos/watch/278d2b7c-0f38-4aaa-afe6-9ecc0c4a34fe", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/peertube-social.json")
+     }}
+  end
+
+  def get("https://mobilizon.org/events/252d5816-00a3-4a89-a66f-15bf65c33e39", _, _, [
+        {"accept", "application/activity+json"}
+      ]) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/mobilizon.org-event.json")
+     }}
+  end
+
+  def get("https://mobilizon.org/@tcit", _, _, [{"accept", "application/activity+json"}]) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/mobilizon.org-user.json")
+     }}
+  end
+
   def get("https://baptiste.gelez.xyz/@/BaptisteGelez", _, _, _) do
     {:ok,
      %Tesla.Env{
@@ -324,7 +348,7 @@ defmodule HttpRequestMock do
      }}
   end
 
-  def get("http://mastodon.example.org/users/admin", _, _, Accept: "application/activity+json") do
+  def get("http://mastodon.example.org/users/admin", _, _, _) do
     {:ok,
      %Tesla.Env{
        status: 200,
@@ -332,203 +356,311 @@ defmodule HttpRequestMock do
      }}
   end
 
-  def get("http://mastodon.example.org/users/gargron", _, _, Accept: "application/activity+json") do
+  def get("http://mastodon.example.org/users/relay", _, _, [
+        {"accept", "application/activity+json"}
+      ]) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/relay@mastdon.example.org.json")
+     }}
+  end
+
+  def get("http://mastodon.example.org/users/gargron", _, _, [
+        {"accept", "application/activity+json"}
+      ]) do
     {:error, :nxdomain}
   end
 
+  def get("http://osada.macgirvin.com/.well-known/host-meta", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 404,
+       body: ""
+     }}
+  end
+
+  def get("https://osada.macgirvin.com/.well-known/host-meta", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 404,
+       body: ""
+     }}
+  end
+
+  def get("http://mastodon.sdf.org/.well-known/host-meta", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/sdf.org_host_meta")
+     }}
+  end
+
+  def get("https://mastodon.sdf.org/.well-known/host-meta", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/sdf.org_host_meta")
+     }}
+  end
+
   def get(
-        "http://mastodon.example.org/@admin/99541947525187367",
+        "https://mastodon.sdf.org/.well-known/webfinger?resource=https://mastodon.sdf.org/users/snowdusk",
         _,
         _,
-        Accept: "application/activity+json"
+        _
       ) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/mastodon-note-object.json")
+       body: File.read!("test/fixtures/tesla_mock/snowdusk@sdf.org_host_meta.json")
      }}
   end
 
-  def get("https://shitposter.club/notice/7369654", _, _, _) do
+  def get("http://mstdn.jp/.well-known/host-meta", _, _, _) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/7369654.html")
+       body: File.read!("test/fixtures/tesla_mock/mstdn.jp_host_meta")
      }}
   end
 
-  def get("https://mstdn.io/users/mayuutann", _, _, Accept: "application/activity+json") do
+  def get("https://mstdn.jp/.well-known/host-meta", _, _, _) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/mayumayu.json")
+       body: File.read!("test/fixtures/tesla_mock/mstdn.jp_host_meta")
      }}
   end
 
-  def get(
-        "https://mstdn.io/users/mayuutann/statuses/99568293732299394",
-        _,
-        _,
-        Accept: "application/activity+json"
-      ) do
+  def get("https://mstdn.jp/.well-known/webfinger?resource=kpherox@mstdn.jp", _, _, _) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/mayumayupost.json")
+       body: File.read!("test/fixtures/tesla_mock/kpherox@mstdn.jp.xml")
      }}
   end
 
-  def get("https://pleroma.soykaf.com/users/lain/feed.atom", _, _, _) do
+  def get("http://mamot.fr/.well-known/host-meta", _, _, _) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body:
-         File.read!(
-           "test/fixtures/tesla_mock/https___pleroma.soykaf.com_users_lain_feed.atom.xml"
-         )
+       body: File.read!("test/fixtures/tesla_mock/mamot.fr_host_meta")
      }}
   end
 
-  def get(url, _, _, Accept: "application/xrd+xml,application/jrd+json")
-      when url in [
-             "https://pleroma.soykaf.com/.well-known/webfinger?resource=acct:https://pleroma.soykaf.com/users/lain",
-             "https://pleroma.soykaf.com/.well-known/webfinger?resource=https://pleroma.soykaf.com/users/lain"
-           ] do
+  def get("https://mamot.fr/.well-known/host-meta", _, _, _) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/https___pleroma.soykaf.com_users_lain.xml")
+       body: File.read!("test/fixtures/tesla_mock/mamot.fr_host_meta")
      }}
   end
 
-  def get("https://shitposter.club/api/statuses/user_timeline/1.atom", _, _, _) do
+  def get("http://pawoo.net/.well-known/host-meta", _, _, _) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body:
-         File.read!(
-           "test/fixtures/tesla_mock/https___shitposter.club_api_statuses_user_timeline_1.atom.xml"
-         )
+       body: File.read!("test/fixtures/tesla_mock/pawoo.net_host_meta")
+     }}
+  end
+
+  def get("https://pawoo.net/.well-known/host-meta", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/pawoo.net_host_meta")
      }}
   end
 
   def get(
-        "https://shitposter.club/.well-known/webfinger?resource=https://shitposter.club/user/1",
+        "https://pawoo.net/.well-known/webfinger?resource=https://pawoo.net/users/pekorino",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        _
       ) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/https___shitposter.club_user_1.xml")
+       body: File.read!("test/fixtures/tesla_mock/pekorino@pawoo.net_host_meta.json")
      }}
   end
 
-  def get("https://shitposter.club/notice/2827873", _, _, _) do
+  def get("http://zetsubou.xn--q9jyb4c/.well-known/host-meta", _, _, _) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/https___shitposter.club_notice_2827873.html")
+       body: File.read!("test/fixtures/tesla_mock/xn--q9jyb4c_host_meta")
      }}
   end
 
-  def get("https://shitposter.club/api/statuses/show/2827873.atom", _, _, _) do
+  def get("https://zetsubou.xn--q9jyb4c/.well-known/host-meta", _, _, _) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body:
-         File.read!(
-           "test/fixtures/tesla_mock/https___shitposter.club_api_statuses_show_2827873.atom.xml"
-         )
+       body: File.read!("test/fixtures/tesla_mock/xn--q9jyb4c_host_meta")
      }}
   end
 
-  def get("https://testing.pleroma.lol/objects/b319022a-4946-44c5-9de9-34801f95507b", _, _, _) do
-    {:ok, %Tesla.Env{status: 200}}
+  def get("http://pleroma.soykaf.com/.well-known/host-meta", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/soykaf.com_host_meta")
+     }}
+  end
+
+  def get("https://pleroma.soykaf.com/.well-known/host-meta", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/soykaf.com_host_meta")
+     }}
   end
 
-  def get("https://shitposter.club/api/statuses/user_timeline/5381.atom", _, _, _) do
+  def get("http://social.stopwatchingus-heidelberg.de/.well-known/host-meta", _, _, _) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/spc_5381.atom")
+       body: File.read!("test/fixtures/tesla_mock/stopwatchingus-heidelberg.de_host_meta")
+     }}
+  end
+
+  def get("https://social.stopwatchingus-heidelberg.de/.well-known/host-meta", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/stopwatchingus-heidelberg.de_host_meta")
      }}
   end
 
   def get(
-        "https://shitposter.club/.well-known/webfinger?resource=https://shitposter.club/user/5381",
+        "http://mastodon.example.org/@admin/99541947525187367",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        _
       ) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/spc_5381_xrd.xml")
+       body: File.read!("test/fixtures/mastodon-note-object.json")
      }}
   end
 
-  def get("http://shitposter.club/.well-known/host-meta", _, _, _) do
+  def get("http://mastodon.example.org/@admin/99541947525187368", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 404,
+       body: ""
+     }}
+  end
+
+  def get("https://shitposter.club/notice/7369654", _, _, _) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/shitposter.club_host_meta")
+       body: File.read!("test/fixtures/tesla_mock/7369654.html")
      }}
   end
 
-  def get("https://shitposter.club/api/statuses/show/7369654.atom", _, _, _) do
+  def get("https://mstdn.io/users/mayuutann", _, _, [{"accept", "application/activity+json"}]) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/7369654.atom")
+       body: File.read!("test/fixtures/tesla_mock/mayumayu.json")
      }}
   end
 
-  def get("https://shitposter.club/notice/4027863", _, _, _) do
+  def get(
+        "https://mstdn.io/users/mayuutann/statuses/99568293732299394",
+        _,
+        _,
+        [{"accept", "application/activity+json"}]
+      ) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/7369654.html")
+       body: File.read!("test/fixtures/tesla_mock/mayumayupost.json")
      }}
   end
 
-  def get("https://social.sakamoto.gq/users/eal/feed.atom", _, _, _) do
+  def get(url, _, _, [{"accept", "application/xrd+xml,application/jrd+json"}])
+      when url in [
+             "https://pleroma.soykaf.com/.well-known/webfinger?resource=acct:https://pleroma.soykaf.com/users/lain",
+             "https://pleroma.soykaf.com/.well-known/webfinger?resource=https://pleroma.soykaf.com/users/lain"
+           ] do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/sakamoto_eal_feed.atom")
+       body: File.read!("test/fixtures/tesla_mock/https___pleroma.soykaf.com_users_lain.xml")
      }}
   end
 
-  def get("http://social.sakamoto.gq/.well-known/host-meta", _, _, _) do
+  def get(
+        "https://shitposter.club/.well-known/webfinger?resource=https://shitposter.club/user/1",
+        _,
+        _,
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
+      ) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/social.sakamoto.gq_host_meta")
+       body: File.read!("test/fixtures/tesla_mock/https___shitposter.club_user_1.xml")
      }}
   end
 
+  def get("https://testing.pleroma.lol/objects/b319022a-4946-44c5-9de9-34801f95507b", _, _, _) do
+    {:ok, %Tesla.Env{status: 200}}
+  end
+
   def get(
-        "https://social.sakamoto.gq/.well-known/webfinger?resource=https://social.sakamoto.gq/users/eal",
+        "https://shitposter.club/.well-known/webfinger?resource=https://shitposter.club/user/5381",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
        status: 200,
-       body: File.read!("test/fixtures/tesla_mock/eal_sakamoto.xml")
+       body: File.read!("test/fixtures/tesla_mock/spc_5381_xrd.xml")
+     }}
+  end
+
+  def get("http://shitposter.club/.well-known/host-meta", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/shitposter.club_host_meta")
+     }}
+  end
+
+  def get("https://shitposter.club/notice/4027863", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/7369654.html")
+     }}
+  end
+
+  def get("http://social.sakamoto.gq/.well-known/host-meta", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/social.sakamoto.gq_host_meta")
      }}
   end
 
   def get(
-        "https://social.sakamoto.gq/objects/0ccc1a2c-66b0-4305-b23a-7f7f2b040056",
+        "https://social.sakamoto.gq/.well-known/webfinger?resource=https://social.sakamoto.gq/users/eal",
         _,
         _,
-        Accept: "application/atom+xml"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
-    {:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/sakamoto.atom")}}
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/eal_sakamoto.xml")
+     }}
   end
 
   def get("http://mastodon.social/.well-known/host-meta", _, _, _) do
@@ -543,7 +675,7 @@ defmodule HttpRequestMock do
         "https://mastodon.social/.well-known/webfinger?resource=https://mastodon.social/users/lambadalambda",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -565,7 +697,7 @@ defmodule HttpRequestMock do
         "http://gs.example.org/.well-known/webfinger?resource=http://gs.example.org:4040/index.php/user/1",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -579,33 +711,11 @@ defmodule HttpRequestMock do
         "http://gs.example.org:4040/index.php/user/1",
         _,
         _,
-        Accept: "application/activity+json"
+        [{"accept", "application/activity+json"}]
       ) do
     {:ok, %Tesla.Env{status: 406, body: ""}}
   end
 
-  def get("http://gs.example.org/index.php/api/statuses/user_timeline/1.atom", _, _, _) do
-    {:ok,
-     %Tesla.Env{
-       status: 200,
-       body:
-         File.read!(
-           "test/fixtures/tesla_mock/http__gs.example.org_index.php_api_statuses_user_timeline_1.atom.xml"
-         )
-     }}
-  end
-
-  def get("https://social.heldscal.la/api/statuses/user_timeline/29191.atom", _, _, _) do
-    {:ok,
-     %Tesla.Env{
-       status: 200,
-       body:
-         File.read!(
-           "test/fixtures/tesla_mock/https___social.heldscal.la_api_statuses_user_timeline_29191.atom.xml"
-         )
-     }}
-  end
-
   def get("http://squeet.me/.well-known/host-meta", _, _, _) do
     {:ok,
      %Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/squeet.me_host_meta")}}
@@ -615,7 +725,7 @@ defmodule HttpRequestMock do
         "https://squeet.me/xrd?uri=lain@squeet.me",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -625,10 +735,10 @@ defmodule HttpRequestMock do
   end
 
   def get(
-        "https://social.heldscal.la/.well-known/webfinger?resource=shp@social.heldscal.la",
+        "https://social.heldscal.la/.well-known/webfinger?resource=acct:shp@social.heldscal.la",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -638,10 +748,10 @@ defmodule HttpRequestMock do
   end
 
   def get(
-        "https://social.heldscal.la/.well-known/webfinger?resource=invalid_content@social.heldscal.la",
+        "https://social.heldscal.la/.well-known/webfinger?resource=acct:invalid_content@social.heldscal.la",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok, %Tesla.Env{status: 200, body: ""}}
   end
@@ -655,10 +765,10 @@ defmodule HttpRequestMock do
   end
 
   def get(
-        "http://framatube.org/main/xrd?uri=framasoft@framatube.org",
+        "http://framatube.org/main/xrd?uri=acct:framasoft@framatube.org",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -680,7 +790,7 @@ defmodule HttpRequestMock do
         "http://gnusocial.de/main/xrd?uri=winterdienst@gnusocial.de",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -714,10 +824,10 @@ defmodule HttpRequestMock do
   end
 
   def get(
-        "https://gerzilla.de/xrd/?uri=kaniini@gerzilla.de",
+        "https://gerzilla.de/xrd/?uri=acct:kaniini@gerzilla.de",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -727,17 +837,6 @@ defmodule HttpRequestMock do
      }}
   end
 
-  def get("https://social.heldscal.la/api/statuses/user_timeline/23211.atom", _, _, _) do
-    {:ok,
-     %Tesla.Env{
-       status: 200,
-       body:
-         File.read!(
-           "test/fixtures/tesla_mock/https___social.heldscal.la_api_statuses_user_timeline_23211.atom.xml"
-         )
-     }}
-  end
-
   def get(
         "https://social.heldscal.la/.well-known/webfinger?resource=https://social.heldscal.la/user/23211",
         _,
@@ -767,10 +866,6 @@ defmodule HttpRequestMock do
      }}
   end
 
-  def get("https://mastodon.social/users/lambadalambda.atom", _, _, _) do
-    {:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/lambadalambda.atom")}}
-  end
-
   def get("https://mastodon.social/users/lambadalambda", _, _, _) do
     {:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/lambadalambda.json")}}
   end
@@ -780,7 +875,7 @@ defmodule HttpRequestMock do
      %Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/osada-user-indio.json")}}
   end
 
-  def get("https://social.heldscal.la/user/23211", _, _, Accept: "application/activity+json") do
+  def get("https://social.heldscal.la/user/23211", _, _, [{"accept", "application/activity+json"}]) do
     {:ok, Tesla.Mock.json(%{"id" => "https://social.heldscal.la/user/23211"}, status: 200)}
   end
 
@@ -828,6 +923,22 @@ defmodule HttpRequestMock do
      }}
   end
 
+  def get("http://localhost:8080/followers/fuser3", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/users_mock/friendica_followers.json")
+     }}
+  end
+
+  def get("http://localhost:8080/following/fuser3", _, _, _) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/users_mock/friendica_following.json")
+     }}
+  end
+
   def get("http://localhost:4001/users/fuser2/followers", _, _, _) do
     {:ok,
      %Tesla.Env{
@@ -894,10 +1005,10 @@ defmodule HttpRequestMock do
   end
 
   def get(
-        "https://zetsubou.xn--q9jyb4c/.well-known/webfinger?resource=lain@zetsubou.xn--q9jyb4c",
+        "https://zetsubou.xn--q9jyb4c/.well-known/webfinger?resource=acct:lain@zetsubou.xn--q9jyb4c",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -907,10 +1018,10 @@ defmodule HttpRequestMock do
   end
 
   def get(
-        "https://zetsubou.xn--q9jyb4c/.well-known/webfinger?resource=https://zetsubou.xn--q9jyb4c/users/lain",
+        "https://zetsubou.xn--q9jyb4c/.well-known/webfinger?resource=acct:https://zetsubou.xn--q9jyb4c/users/lain",
         _,
         _,
-        Accept: "application/xrd+xml,application/jrd+json"
+        [{"accept", "application/xrd+xml,application/jrd+json"}]
       ) do
     {:ok,
      %Tesla.Env{
@@ -932,7 +1043,9 @@ defmodule HttpRequestMock do
      }}
   end
 
-  def get("https://info.pleroma.site/activity.json", _, _, Accept: "application/activity+json") do
+  def get("https://info.pleroma.site/activity.json", _, _, [
+        {"accept", "application/activity+json"}
+      ]) do
     {:ok,
      %Tesla.Env{
        status: 200,
@@ -944,7 +1057,9 @@ defmodule HttpRequestMock 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,
      %Tesla.Env{
        status: 200,
@@ -956,7 +1071,9 @@ defmodule HttpRequestMock 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,
      %Tesla.Env{
        status: 200,
@@ -976,6 +1093,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
@@ -1000,10 +1141,53 @@ defmodule HttpRequestMock do
      }}
   end
 
+  def get("https://example.org/emoji/firedfox.png", _, _, _) do
+    {:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/image.jpg")}}
+  end
+
   def get("https://skippers-bin.com/users/7v1w1r8ce6", _, _, _) do
     {:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/sjw.json")}}
   end
 
+  def get("https://patch.cx/users/rin", _, _, _) do
+    {:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/rin.json")}}
+  end
+
+  def get(
+        "https://channels.tests.funkwhale.audio/federation/music/uploads/42342395-0208-4fee-a38d-259a6dae0871",
+        _,
+        _,
+        _
+      ) do
+    {:ok,
+     %Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/funkwhale_audio.json")}}
+  end
+
+  def get("https://channels.tests.funkwhale.audio/federation/actors/compositions", _, _, _) do
+    {:ok,
+     %Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/funkwhale_channel.json")}}
+  end
+
+  def get("http://example.com/rel_me/error", _, _, _) 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("http://localhost:4001/", _, "", [{"accept", "text/html"}]) do
+    {:ok, %Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/7369654.html")}}
+  end
+
+  def get("https://osada.macgirvin.com/", _, "", [{"accept", "text/html"}]) do
+    {:ok,
+     %Tesla.Env{
+       status: 200,
+       body: File.read!("test/fixtures/tesla_mock/https___osada.macgirvin.com.html")
+     }}
+  end
+
   def get(url, query, body, headers) do
     {:error,
      "Mock response not implemented for GET #{inspect(url)}, #{query}, #{inspect(body)}, #{
@@ -1016,6 +1200,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{