diff options
| author | Maxim Filippov <colixer@gmail.com> | 2019-10-10 03:33:55 +0300 | 
|---|---|---|
| committer | Maxim Filippov <colixer@gmail.com> | 2019-10-10 03:33:55 +0300 | 
| commit | 24eecc3cb4a35376124b1fc792183d8b8dd0a9cc (patch) | |
| tree | eac6f8b374bab49869de8bd0496e09938c9a65fa /test/support | |
| parent | aa7fd616c7cfeb84551af2170886856a815dc498 (diff) | |
| parent | 9fd5176c35d21846fb8368ea7bc0285f9cd74ad4 (diff) | |
| download | pleroma-24eecc3cb4a35376124b1fc792183d8b8dd0a9cc.tar.gz pleroma-24eecc3cb4a35376124b1fc792183d8b8dd0a9cc.zip | |
Merge branch 'develop' into feature/reports-groups-and-multiple-state-update
Diffstat (limited to 'test/support')
| -rw-r--r-- | test/support/http_request_mock.ex | 175 | 
1 files changed, 175 insertions, 0 deletions
| diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex index b825a9307..4feb57f3a 100644 --- a/test/support/http_request_mock.ex +++ b/test/support/http_request_mock.ex @@ -344,6 +344,181 @@ defmodule HttpRequestMock 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( +        "https://mastodon.sdf.org/.well-known/webfinger?resource=https://mastodon.sdf.org/users/snowdusk", +        _, +        _, +        _ +      ) do +    {:ok, +     %Tesla.Env{ +       status: 200, +       body: File.read!("test/fixtures/tesla_mock/snowdusk@sdf.org_host_meta.json") +     }} +  end + +  def get("http://mstdn.jp/.well-known/host-meta", _, _, _) do +    {:ok, +     %Tesla.Env{ +       status: 200, +       body: File.read!("test/fixtures/tesla_mock/mstdn.jp_host_meta") +     }} +  end + +  def get("https://mstdn.jp/.well-known/host-meta", _, _, _) do +    {:ok, +     %Tesla.Env{ +       status: 200, +       body: File.read!("test/fixtures/tesla_mock/mstdn.jp_host_meta") +     }} +  end + +  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/kpherox@mstdn.jp.xml") +     }} +  end + +  def get("http://mamot.fr/.well-known/host-meta", _, _, _) do +    {:ok, +     %Tesla.Env{ +       status: 200, +       body: File.read!("test/fixtures/tesla_mock/mamot.fr_host_meta") +     }} +  end + +  def get("https://mamot.fr/.well-known/host-meta", _, _, _) do +    {:ok, +     %Tesla.Env{ +       status: 200, +       body: File.read!("test/fixtures/tesla_mock/mamot.fr_host_meta") +     }} +  end + +  def get( +        "https://mamot.fr/.well-known/webfinger?resource=https://mamot.fr/users/Skruyb", +        _, +        _, +        _ +      ) do +    {:ok, +     %Tesla.Env{ +       status: 200, +       body: File.read!("test/fixtures/tesla_mock/skruyb@mamot.fr.atom") +     }} +  end + +  def get("http://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://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://pawoo.net/.well-known/webfinger?resource=https://pawoo.net/users/pekorino", +        _, +        _, +        _ +      ) do +    {:ok, +     %Tesla.Env{ +       status: 200, +       body: File.read!("test/fixtures/tesla_mock/pekorino@pawoo.net_host_meta.json") +     }} +  end + +  def get("http://zetsubou.xn--q9jyb4c/.well-known/host-meta", _, _, _) do +    {:ok, +     %Tesla.Env{ +       status: 200, +       body: File.read!("test/fixtures/tesla_mock/xn--q9jyb4c_host_meta") +     }} +  end + +  def get("https://zetsubou.xn--q9jyb4c/.well-known/host-meta", _, _, _) do +    {:ok, +     %Tesla.Env{ +       status: 200, +       body: File.read!("test/fixtures/tesla_mock/xn--q9jyb4c_host_meta") +     }} +  end + +  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("http://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://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(          "http://mastodon.example.org/@admin/99541947525187367",          _, | 
