diff options
author | lain <lain@soykaf.club> | 2018-02-23 15:00:41 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-02-23 15:00:41 +0100 |
commit | aa79d64e0d278e30cb05cc3145a9539ea684bc6f (patch) | |
tree | 2297611c109b01905f0182a37710698b693fe290 /test/support | |
parent | 2583a9f6e85dcc83940c763f83bea6a48c6d3528 (diff) | |
download | pleroma-aa79d64e0d278e30cb05cc3145a9539ea684bc6f.tar.gz |
Correctly stitch mastodon -> ostatus replies.
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/httpoison_mock.ex | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/support/httpoison_mock.ex b/test/support/httpoison_mock.ex index b8f2422f6..ad9be9aef 100644 --- a/test/support/httpoison_mock.ex +++ b/test/support/httpoison_mock.ex @@ -80,6 +80,13 @@ defmodule HTTPoisonMock do }} end + def get("https://shitposter.club/.well-known/webfinger?resource=https://shitposter.club/user/5381", [Accept: "application/xrd+xml"], []) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/spc_5381_xrd.xml") + }} + end + def get("http://gs.example.org/.well-known/webfinger", [Accept: "application/xrd+xml"], [params: [resource: "http://gs.example.org:4040/index.php/user/1"], follow_redirect: true]) do {:ok, %Response{ status_code: 200, @@ -122,6 +129,13 @@ defmodule HTTPoisonMock do }} end + def get("https://shitposter.club/api/statuses/user_timeline/5381.atom", _body, _headers) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/spc_5381.atom") + }} + end + def get("https://social.heldscal.la/api/statuses/user_timeline/23211.atom", _body, _headers) do {:ok, %Response{ status_code: 200, @@ -387,6 +401,13 @@ defmodule HTTPoisonMock do }} end + def get("https://mstdn.io/users/mayuutann", ["Accept": "application/activity+json"], _) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/mayumayu.json") + }} + end + def get("http://mastodon.example.org/@admin/99541947525187367", ["Accept": "application/activity+json"], _) do {:ok, %Response{ status_code: 200, @@ -394,6 +415,27 @@ defmodule HTTPoisonMock do }} end + def get("https://mstdn.io/users/mayuutann/statuses/99568293732299394", ["Accept": "application/activity+json"], _) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/mayumayupost.json") + }} + end + + def get("https://shitposter.club/notice/7369654", _, _) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/7369654.html") + }} + end + + def get("https://shitposter.club/api/statuses/show/7369654.atom", _body, _headers) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/7369654.atom") + }} + end + def get(url, body, headers) do {:error, "Not implemented the mock response for get #{inspect(url)}, #{inspect(body)}, #{inspect(headers)}"} end |