1 defmodule HTTPoisonMock do
2 alias HTTPoison.Response
4 def get(url, body \\ [], headers \\ [])
7 "https://gerzilla.de/.well-known/webfinger?resource=acct:kaniini@gerzilla.de",
8 [Accept: "application/xrd+xml,application/jrd+json"],
14 body: File.read!("test/fixtures/httpoison_mock/kaniini@gerzilla.de.json")
19 "https://framatube.org/.well-known/webfinger?resource=acct:framasoft@framatube.org",
20 [Accept: "application/xrd+xml,application/jrd+json"],
26 body: File.read!("test/fixtures/httpoison_mock/framasoft@framatube.org.json")
31 "https://gnusocial.de/.well-known/webfinger?resource=acct:winterdienst@gnusocial.de",
32 [Accept: "application/xrd+xml,application/jrd+json"],
38 body: File.read!("test/fixtures/httpoison_mock/winterdienst_webfinger.json")
43 "https://social.heldscal.la/.well-known/webfinger",
44 [Accept: "application/xrd+xml,application/jrd+json"],
45 params: [resource: "nonexistant@social.heldscal.la"],
51 body: File.read!("test/fixtures/httpoison_mock/nonexistant@social.heldscal.la.xml")
56 "https://social.heldscal.la/.well-known/webfinger?resource=shp@social.heldscal.la",
57 [Accept: "application/xrd+xml,application/jrd+json"],
63 body: File.read!("test/fixtures/httpoison_mock/shp@social.heldscal.la.xml")
68 "https://social.heldscal.la/.well-known/webfinger",
69 [Accept: "application/xrd+xml,application/jrd+json"],
70 params: [resource: "shp@social.heldscal.la"],
76 body: File.read!("test/fixtures/httpoison_mock/shp@social.heldscal.la.xml")
81 "https://social.heldscal.la/.well-known/webfinger",
82 [Accept: "application/xrd+xml,application/jrd+json"],
83 params: [resource: "https://social.heldscal.la/user/23211"],
89 body: File.read!("test/fixtures/httpoison_mock/https___social.heldscal.la_user_23211.xml")
94 "https://social.heldscal.la/.well-known/webfinger?resource=https://social.heldscal.la/user/23211",
95 [Accept: "application/xrd+xml,application/jrd+json"],
101 body: File.read!("test/fixtures/httpoison_mock/https___social.heldscal.la_user_23211.xml")
106 "https://social.heldscal.la/.well-known/webfinger",
107 [Accept: "application/xrd+xml,application/jrd+json"],
108 params: [resource: "https://social.heldscal.la/user/29191"],
109 follow_redirect: true
114 body: File.read!("test/fixtures/httpoison_mock/https___social.heldscal.la_user_29191.xml")
119 "https://social.heldscal.la/.well-known/webfinger?resource=https://social.heldscal.la/user/29191",
120 [Accept: "application/xrd+xml,application/jrd+json"],
121 follow_redirect: true
126 body: File.read!("test/fixtures/httpoison_mock/https___social.heldscal.la_user_29191.xml")
131 "https://mastodon.social/.well-known/webfinger",
132 [Accept: "application/xrd+xml,application/jrd+json"],
133 params: [resource: "https://mastodon.social/users/lambadalambda"],
134 follow_redirect: true
141 "test/fixtures/httpoison_mock/https___mastodon.social_users_lambadalambda.xml"
147 "https://mastodon.social/.well-known/webfinger?resource=https://mastodon.social/users/lambadalambda",
148 [Accept: "application/xrd+xml,application/jrd+json"],
149 follow_redirect: true
156 "test/fixtures/httpoison_mock/https___mastodon.social_users_lambadalambda.xml"
162 "https://shitposter.club/.well-known/webfinger",
163 [Accept: "application/xrd+xml,application/jrd+json"],
164 params: [resource: "https://shitposter.club/user/1"],
165 follow_redirect: true
170 body: File.read!("test/fixtures/httpoison_mock/https___shitposter.club_user_1.xml")
175 "https://shitposter.club/.well-known/webfinger?resource=https://shitposter.club/user/1",
176 [Accept: "application/xrd+xml,application/jrd+json"],
177 follow_redirect: true
182 body: File.read!("test/fixtures/httpoison_mock/https___shitposter.club_user_1.xml")
187 "https://shitposter.club/.well-known/webfinger?resource=https://shitposter.club/user/5381",
188 [Accept: "application/xrd+xml,application/jrd+json"],
189 follow_redirect: true
194 body: File.read!("test/fixtures/httpoison_mock/spc_5381_xrd.xml")
199 "http://gs.example.org/.well-known/webfinger",
200 [Accept: "application/xrd+xml,application/jrd+json"],
201 params: [resource: "http://gs.example.org:4040/index.php/user/1"],
202 follow_redirect: true
209 "test/fixtures/httpoison_mock/http___gs.example.org_4040_index.php_user_1.xml"
215 "http://gs.example.org/.well-known/webfinger?resource=http://gs.example.org:4040/index.php/user/1",
216 [Accept: "application/xrd+xml,application/jrd+json"],
217 follow_redirect: true
224 "test/fixtures/httpoison_mock/http___gs.example.org_4040_index.php_user_1.xml"
230 "https://social.stopwatchingus-heidelberg.de/.well-known/webfinger?resource=https://social.stopwatchingus-heidelberg.de/user/18330",
231 [Accept: "application/xrd+xml,application/jrd+json"],
232 follow_redirect: true
237 body: File.read!("test/fixtures/httpoison_mock/atarifrosch_webfinger.xml")
242 "https://pleroma.soykaf.com/.well-known/webfinger",
243 [Accept: "application/xrd+xml,application/jrd+json"],
244 params: [resource: "https://pleroma.soykaf.com/users/lain"],
245 follow_redirect: true
250 body: File.read!("test/fixtures/httpoison_mock/https___pleroma.soykaf.com_users_lain.xml")
255 "https://pleroma.soykaf.com/.well-known/webfinger?resource=https://pleroma.soykaf.com/users/lain",
256 [Accept: "application/xrd+xml,application/jrd+json"],
257 follow_redirect: true
262 body: File.read!("test/fixtures/httpoison_mock/https___pleroma.soykaf.com_users_lain.xml")
266 def get("https://social.heldscal.la/api/statuses/user_timeline/29191.atom", _body, _headers) do
272 "test/fixtures/httpoison_mock/https___social.heldscal.la_api_statuses_user_timeline_29191.atom.xml"
277 def get("https://shitposter.club/api/statuses/user_timeline/5381.atom", _body, _headers) do
281 body: File.read!("test/fixtures/httpoison_mock/spc_5381.atom")
285 def get("https://social.heldscal.la/api/statuses/user_timeline/23211.atom", _body, _headers) do
291 "test/fixtures/httpoison_mock/https___social.heldscal.la_api_statuses_user_timeline_23211.atom.xml"
296 def get("https://mastodon.social/users/lambadalambda.atom", _body, _headers) do
302 "test/fixtures/httpoison_mock/https___mastodon.social_users_lambadalambda.atom"
308 "https://social.stopwatchingus-heidelberg.de/api/statuses/user_timeline/18330.atom",
315 body: File.read!("test/fixtures/httpoison_mock/atarifrosch_feed.xml")
319 def get("https://pleroma.soykaf.com/users/lain/feed.atom", _body, _headers) do
325 "test/fixtures/httpoison_mock/https___pleroma.soykaf.com_users_lain_feed.atom.xml"
330 def get("https://social.sakamoto.gq/users/eal/feed.atom", _body, _headers) do
334 body: File.read!("test/fixtures/httpoison_mock/sakamoto_eal_feed.atom")
338 def get("http://gs.example.org/index.php/api/statuses/user_timeline/1.atom", _body, _headers) do
344 "test/fixtures/httpoison_mock/http__gs.example.org_index.php_api_statuses_user_timeline_1.atom.xml"
349 def get("https://shitposter.club/notice/2827873", _body, _headers) do
354 File.read!("test/fixtures/httpoison_mock/https___shitposter.club_notice_2827873.html")
358 def get("https://shitposter.club/api/statuses/show/2827873.atom", _body, _headers) do
364 "test/fixtures/httpoison_mock/https___shitposter.club_api_statuses_show_2827873.atom.xml"
369 def get("https://shitposter.club/api/statuses/user_timeline/1.atom", _body, _headers) do
375 "test/fixtures/httpoison_mock/https___shitposter.club_api_statuses_user_timeline_1.atom.xml"
381 "https://social.heldscal.la/main/push/hub",
383 "Content-type": "application/x-www-form-urlencoded"
392 "https://pawoo.net/.well-known/webfinger",
393 [Accept: "application/xrd+xml,application/jrd+json"],
394 params: [resource: "https://pawoo.net/users/pekorino"],
395 follow_redirect: true
400 body: File.read!("test/fixtures/httpoison_mock/https___pawoo.net_users_pekorino.xml")
405 "https://pawoo.net/.well-known/webfinger?resource=https://pawoo.net/users/pekorino",
406 [Accept: "application/xrd+xml,application/jrd+json"],
407 follow_redirect: true
412 body: File.read!("test/fixtures/httpoison_mock/https___pawoo.net_users_pekorino.xml")
416 def get("https://pawoo.net/users/pekorino.atom", _, _) do
420 body: File.read!("test/fixtures/httpoison_mock/https___pawoo.net_users_pekorino.atom")
425 "https://mamot.fr/.well-known/webfinger",
426 [Accept: "application/xrd+xml,application/jrd+json"],
427 params: [resource: "https://mamot.fr/users/Skruyb"],
428 follow_redirect: true
433 body: File.read!("test/fixtures/httpoison_mock/skruyb@mamot.fr.atom")
438 "https://mamot.fr/.well-known/webfinger?resource=https://mamot.fr/users/Skruyb",
439 [Accept: "application/xrd+xml,application/jrd+json"],
440 follow_redirect: true
445 body: File.read!("test/fixtures/httpoison_mock/skruyb@mamot.fr.atom")
450 "https://social.sakamoto.gq/.well-known/webfinger",
451 [Accept: "application/xrd+xml,application/jrd+json"],
452 params: [resource: "https://social.sakamoto.gq/users/eal"],
453 follow_redirect: true
458 body: File.read!("test/fixtures/httpoison_mock/eal_sakamoto.xml")
463 "https://social.sakamoto.gq/.well-known/webfinger?resource=https://social.sakamoto.gq/users/eal",
464 [Accept: "application/xrd+xml,application/jrd+json"],
465 follow_redirect: true
470 body: File.read!("test/fixtures/httpoison_mock/eal_sakamoto.xml")
475 "https://pleroma.soykaf.com/.well-known/webfinger?resource=https://pleroma.soykaf.com/users/shp",
476 [Accept: "application/xrd+xml,application/jrd+json"],
477 follow_redirect: true
482 body: File.read!("test/fixtures/httpoison_mock/shp@pleroma.soykaf.com.webfigner")
487 "https://squeet.me/xrd/?uri=lain@squeet.me",
488 [Accept: "application/xrd+xml,application/jrd+json"],
489 follow_redirect: true
494 body: File.read!("test/fixtures/httpoison_mock/lain_squeet.me_webfinger.xml")
498 def get("https://mamot.fr/users/Skruyb.atom", _, _) do
502 body: File.read!("test/fixtures/httpoison_mock/https___mamot.fr_users_Skruyb.atom")
507 "https://social.sakamoto.gq/objects/0ccc1a2c-66b0-4305-b23a-7f7f2b040056",
508 [Accept: "application/atom+xml"],
514 body: File.read!("test/fixtures/httpoison_mock/sakamoto.atom")
518 def get("https://pleroma.soykaf.com/users/shp/feed.atom", _, _) do
522 body: File.read!("test/fixtures/httpoison_mock/shp@pleroma.soykaf.com.feed")
526 def get("http://social.heldscal.la/.well-known/host-meta", [], follow_redirect: true) do
530 body: File.read!("test/fixtures/httpoison_mock/social.heldscal.la_host_meta")
534 def get("http://status.alpicola.com/.well-known/host-meta", [], follow_redirect: true) do
538 body: File.read!("test/fixtures/httpoison_mock/status.alpicola.com_host_meta")
542 def get("http://macgirvin.com/.well-known/host-meta", [], follow_redirect: true) do
546 body: File.read!("test/fixtures/httpoison_mock/macgirvin.com_host_meta")
550 def get("http://mastodon.social/.well-known/host-meta", [], follow_redirect: true) do
554 body: File.read!("test/fixtures/httpoison_mock/mastodon.social_host_meta")
558 def get("http://shitposter.club/.well-known/host-meta", [], follow_redirect: true) do
562 body: File.read!("test/fixtures/httpoison_mock/shitposter.club_host_meta")
566 def get("http://pleroma.soykaf.com/.well-known/host-meta", [], follow_redirect: true) do
570 body: File.read!("test/fixtures/httpoison_mock/pleroma.soykaf.com_host_meta")
574 def get("http://social.sakamoto.gq/.well-known/host-meta", [], follow_redirect: true) do
578 body: File.read!("test/fixtures/httpoison_mock/social.sakamoto.gq_host_meta")
582 def get("http://gs.example.org/.well-known/host-meta", [], follow_redirect: true) do
586 body: File.read!("test/fixtures/httpoison_mock/gs.example.org_host_meta")
590 def get("http://pawoo.net/.well-known/host-meta", [], follow_redirect: true) do
594 body: File.read!("test/fixtures/httpoison_mock/pawoo.net_host_meta")
598 def get("http://mamot.fr/.well-known/host-meta", [], follow_redirect: true) do
602 body: File.read!("test/fixtures/httpoison_mock/mamot.fr_host_meta")
606 def get("http://mastodon.xyz/.well-known/host-meta", [], follow_redirect: true) do
610 body: File.read!("test/fixtures/httpoison_mock/mastodon.xyz_host_meta")
614 def get("http://social.wxcafe.net/.well-known/host-meta", [], follow_redirect: true) do
618 body: File.read!("test/fixtures/httpoison_mock/social.wxcafe.net_host_meta")
622 def get("http://squeet.me/.well-known/host-meta", [], follow_redirect: true) do
626 body: File.read!("test/fixtures/httpoison_mock/squeet.me_host_meta")
631 "http://social.stopwatchingus-heidelberg.de/.well-known/host-meta",
633 follow_redirect: true
639 File.read!("test/fixtures/httpoison_mock/social.stopwatchingus-heidelberg.de_host_meta")
643 def get("http://mastodon.example.org/users/admin", [Accept: "application/activity+json"], _) do
647 body: File.read!("test/fixtures/httpoison_mock/admin@mastdon.example.org.json")
652 "https://hubzilla.example.org/channel/kaniini",
653 [Accept: "application/activity+json"],
659 body: File.read!("test/fixtures/httpoison_mock/kaniini@hubzilla.example.org.json")
663 def get("https://masto.quad.moe/users/_HellPie", [Accept: "application/activity+json"], _) do
667 body: File.read!("test/fixtures/httpoison_mock/hellpie.json")
671 def get("https://niu.moe/users/rye", [Accept: "application/activity+json"], _) do
675 body: File.read!("test/fixtures/httpoison_mock/rye.json")
680 "https://mst3k.interlinked.me/users/luciferMysticus",
681 [Accept: "application/activity+json"],
687 body: File.read!("test/fixtures/httpoison_mock/lucifermysticus.json")
691 def get("https://mstdn.io/users/mayuutann", [Accept: "application/activity+json"], _) do
695 body: File.read!("test/fixtures/httpoison_mock/mayumayu.json")
700 "http://mastodon.example.org/@admin/99541947525187367",
701 [Accept: "application/activity+json"],
707 body: File.read!("test/fixtures/mastodon-note-object.json")
712 "https://mstdn.io/users/mayuutann/statuses/99568293732299394",
713 [Accept: "application/activity+json"],
719 body: File.read!("test/fixtures/httpoison_mock/mayumayupost.json")
723 def get("https://shitposter.club/notice/7369654", _, _) do
727 body: File.read!("test/fixtures/httpoison_mock/7369654.html")
731 def get("https://shitposter.club/api/statuses/show/7369654.atom", _body, _headers) do
735 body: File.read!("test/fixtures/httpoison_mock/7369654.atom")
739 def get("https://baptiste.gelez.xyz/~/PlumeDevelopment/this-month-in-plume-june-2018/", _, _) do
743 body: File.read!("test/fixtures/httpoison_mock/baptiste.gelex.xyz-article.json")
747 def get("https://baptiste.gelez.xyz/@/BaptisteGelez", _, _) do
751 body: File.read!("test/fixtures/httpoison_mock/baptiste.gelex.xyz-user.json")
755 def get(url, body, headers) do
757 "Not implemented the mock response for get #{inspect(url)}, #{inspect(body)}, #{
762 def post(url, _body, _headers) do
763 {:error, "Not implemented the mock response for post #{inspect(url)}"}
766 def post(url, _body, _headers, _options) do
767 {:error, "Not implemented the mock response for post #{inspect(url)}"}