Correctly stitch mastodon -> ostatus replies.
This commit is contained in:
parent
2583a9f6e8
commit
aa79d64e0d
10 changed files with 1235 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue