Merge branch 'bugfix/local-jsonld-context' into 'develop'
[akkoma] / test / support / httpoison_mock.ex
1 defmodule HTTPoisonMock do
2 alias HTTPoison.Response
3
4 def get(url, body \\ [], headers \\ [])
5
6 def get("https://prismo.news/@mxb", _, _) do
7 {:ok,
8 %Response{
9 status_code: 200,
10 body: File.read!("test/fixtures/httpoison_mock/https___prismo.news__mxb.json")
11 }}
12 end
13
14 def get("https://osada.macgirvin.com/channel/mike", _, _) do
15 {:ok,
16 %Response{
17 status_code: 200,
18 body:
19 File.read!("test/fixtures/httpoison_mock/https___osada.macgirvin.com_channel_mike.json")
20 }}
21 end
22
23 def get(
24 "https://osada.macgirvin.com/.well-known/webfinger?resource=acct:mike@osada.macgirvin.com",
25 _,
26 _
27 ) do
28 {:ok,
29 %Response{
30 status_code: 200,
31 body: File.read!("test/fixtures/httpoison_mock/mike@osada.macgirvin.com.json")
32 }}
33 end
34
35 def get("https://info.pleroma.site/activity.json", _, _) do
36 {:ok,
37 %Response{
38 status_code: 200,
39 body: File.read!("test/fixtures/httpoison_mock/https__info.pleroma.site_activity.json")
40 }}
41 end
42
43 def get("https://puckipedia.com/", [Accept: "application/activity+json"], _) do
44 {:ok,
45 %Response{
46 status_code: 200,
47 body: File.read!("test/fixtures/httpoison_mock/puckipedia.com.json")
48 }}
49 end
50
51 def get(
52 "https://gerzilla.de/.well-known/webfinger?resource=acct:kaniini@gerzilla.de",
53 [Accept: "application/xrd+xml,application/jrd+json"],
54 follow_redirect: true
55 ) do
56 {:ok,
57 %Response{
58 status_code: 200,
59 body: File.read!("test/fixtures/httpoison_mock/kaniini@gerzilla.de.json")
60 }}
61 end
62
63 def get(
64 "https://framatube.org/.well-known/webfinger?resource=acct:framasoft@framatube.org",
65 [Accept: "application/xrd+xml,application/jrd+json"],
66 follow_redirect: true
67 ) do
68 {:ok,
69 %Response{
70 status_code: 200,
71 body: File.read!("test/fixtures/httpoison_mock/framasoft@framatube.org.json")
72 }}
73 end
74
75 def get(
76 "https://gnusocial.de/.well-known/webfinger?resource=acct:winterdienst@gnusocial.de",
77 [Accept: "application/xrd+xml,application/jrd+json"],
78 follow_redirect: true
79 ) do
80 {:ok,
81 %Response{
82 status_code: 200,
83 body: File.read!("test/fixtures/httpoison_mock/winterdienst_webfinger.json")
84 }}
85 end
86
87 def get(
88 "https://social.heldscal.la/.well-known/webfinger",
89 [Accept: "application/xrd+xml,application/jrd+json"],
90 params: [resource: "nonexistant@social.heldscal.la"],
91 follow_redirect: true
92 ) do
93 {:ok,
94 %Response{
95 status_code: 500,
96 body: File.read!("test/fixtures/httpoison_mock/nonexistant@social.heldscal.la.xml")
97 }}
98 end
99
100 def get(
101 "https://social.heldscal.la/.well-known/webfinger?resource=shp@social.heldscal.la",
102 [Accept: "application/xrd+xml,application/jrd+json"],
103 follow_redirect: true
104 ) do
105 {:ok,
106 %Response{
107 status_code: 200,
108 body: File.read!("test/fixtures/httpoison_mock/shp@social.heldscal.la.xml")
109 }}
110 end
111
112 def get(
113 "https://social.heldscal.la/.well-known/webfinger",
114 [Accept: "application/xrd+xml,application/jrd+json"],
115 params: [resource: "shp@social.heldscal.la"],
116 follow_redirect: true
117 ) do
118 {:ok,
119 %Response{
120 status_code: 200,
121 body: File.read!("test/fixtures/httpoison_mock/shp@social.heldscal.la.xml")
122 }}
123 end
124
125 def get(
126 "https://social.heldscal.la/.well-known/webfinger",
127 [Accept: "application/xrd+xml,application/jrd+json"],
128 params: [resource: "https://social.heldscal.la/user/23211"],
129 follow_redirect: true
130 ) do
131 {:ok,
132 %Response{
133 status_code: 200,
134 body: File.read!("test/fixtures/httpoison_mock/https___social.heldscal.la_user_23211.xml")
135 }}
136 end
137
138 def get(
139 "https://social.heldscal.la/.well-known/webfinger?resource=https://social.heldscal.la/user/23211",
140 [Accept: "application/xrd+xml,application/jrd+json"],
141 follow_redirect: true
142 ) do
143 {:ok,
144 %Response{
145 status_code: 200,
146 body: File.read!("test/fixtures/httpoison_mock/https___social.heldscal.la_user_23211.xml")
147 }}
148 end
149
150 def get(
151 "https://social.heldscal.la/.well-known/webfinger",
152 [Accept: "application/xrd+xml,application/jrd+json"],
153 params: [resource: "https://social.heldscal.la/user/29191"],
154 follow_redirect: true
155 ) do
156 {:ok,
157 %Response{
158 status_code: 200,
159 body: File.read!("test/fixtures/httpoison_mock/https___social.heldscal.la_user_29191.xml")
160 }}
161 end
162
163 def get(
164 "https://social.heldscal.la/.well-known/webfinger?resource=https://social.heldscal.la/user/29191",
165 [Accept: "application/xrd+xml,application/jrd+json"],
166 follow_redirect: true
167 ) do
168 {:ok,
169 %Response{
170 status_code: 200,
171 body: File.read!("test/fixtures/httpoison_mock/https___social.heldscal.la_user_29191.xml")
172 }}
173 end
174
175 def get(
176 "https://mastodon.social/.well-known/webfinger",
177 [Accept: "application/xrd+xml,application/jrd+json"],
178 params: [resource: "https://mastodon.social/users/lambadalambda"],
179 follow_redirect: true
180 ) do
181 {:ok,
182 %Response{
183 status_code: 200,
184 body:
185 File.read!(
186 "test/fixtures/httpoison_mock/https___mastodon.social_users_lambadalambda.xml"
187 )
188 }}
189 end
190
191 def get(
192 "https://mastodon.social/.well-known/webfinger?resource=https://mastodon.social/users/lambadalambda",
193 [Accept: "application/xrd+xml,application/jrd+json"],
194 follow_redirect: true
195 ) do
196 {:ok,
197 %Response{
198 status_code: 200,
199 body:
200 File.read!(
201 "test/fixtures/httpoison_mock/https___mastodon.social_users_lambadalambda.xml"
202 )
203 }}
204 end
205
206 def get(
207 "https://shitposter.club/.well-known/webfinger",
208 [Accept: "application/xrd+xml,application/jrd+json"],
209 params: [resource: "https://shitposter.club/user/1"],
210 follow_redirect: true
211 ) do
212 {:ok,
213 %Response{
214 status_code: 200,
215 body: File.read!("test/fixtures/httpoison_mock/https___shitposter.club_user_1.xml")
216 }}
217 end
218
219 def get(
220 "https://shitposter.club/.well-known/webfinger?resource=https://shitposter.club/user/1",
221 [Accept: "application/xrd+xml,application/jrd+json"],
222 follow_redirect: true
223 ) do
224 {:ok,
225 %Response{
226 status_code: 200,
227 body: File.read!("test/fixtures/httpoison_mock/https___shitposter.club_user_1.xml")
228 }}
229 end
230
231 def get(
232 "https://shitposter.club/.well-known/webfinger?resource=https://shitposter.club/user/5381",
233 [Accept: "application/xrd+xml,application/jrd+json"],
234 follow_redirect: true
235 ) do
236 {:ok,
237 %Response{
238 status_code: 200,
239 body: File.read!("test/fixtures/httpoison_mock/spc_5381_xrd.xml")
240 }}
241 end
242
243 def get(
244 "http://gs.example.org/.well-known/webfinger",
245 [Accept: "application/xrd+xml,application/jrd+json"],
246 params: [resource: "http://gs.example.org:4040/index.php/user/1"],
247 follow_redirect: true
248 ) do
249 {:ok,
250 %Response{
251 status_code: 200,
252 body:
253 File.read!(
254 "test/fixtures/httpoison_mock/http___gs.example.org_4040_index.php_user_1.xml"
255 )
256 }}
257 end
258
259 def get(
260 "http://gs.example.org/.well-known/webfinger?resource=http://gs.example.org:4040/index.php/user/1",
261 [Accept: "application/xrd+xml,application/jrd+json"],
262 follow_redirect: true
263 ) do
264 {:ok,
265 %Response{
266 status_code: 200,
267 body:
268 File.read!(
269 "test/fixtures/httpoison_mock/http___gs.example.org_4040_index.php_user_1.xml"
270 )
271 }}
272 end
273
274 def get(
275 "https://social.stopwatchingus-heidelberg.de/.well-known/webfinger?resource=https://social.stopwatchingus-heidelberg.de/user/18330",
276 [Accept: "application/xrd+xml,application/jrd+json"],
277 follow_redirect: true
278 ) do
279 {:ok,
280 %Response{
281 status_code: 200,
282 body: File.read!("test/fixtures/httpoison_mock/atarifrosch_webfinger.xml")
283 }}
284 end
285
286 def get(
287 "https://pleroma.soykaf.com/.well-known/webfinger",
288 [Accept: "application/xrd+xml,application/jrd+json"],
289 params: [resource: "https://pleroma.soykaf.com/users/lain"],
290 follow_redirect: true
291 ) do
292 {:ok,
293 %Response{
294 status_code: 200,
295 body: File.read!("test/fixtures/httpoison_mock/https___pleroma.soykaf.com_users_lain.xml")
296 }}
297 end
298
299 def get(
300 "https://pleroma.soykaf.com/.well-known/webfinger?resource=https://pleroma.soykaf.com/users/lain",
301 [Accept: "application/xrd+xml,application/jrd+json"],
302 follow_redirect: true
303 ) do
304 {:ok,
305 %Response{
306 status_code: 200,
307 body: File.read!("test/fixtures/httpoison_mock/https___pleroma.soykaf.com_users_lain.xml")
308 }}
309 end
310
311 def get("https://social.heldscal.la/api/statuses/user_timeline/29191.atom", _body, _headers) do
312 {:ok,
313 %Response{
314 status_code: 200,
315 body:
316 File.read!(
317 "test/fixtures/httpoison_mock/https___social.heldscal.la_api_statuses_user_timeline_29191.atom.xml"
318 )
319 }}
320 end
321
322 def get("https://shitposter.club/api/statuses/user_timeline/5381.atom", _body, _headers) do
323 {:ok,
324 %Response{
325 status_code: 200,
326 body: File.read!("test/fixtures/httpoison_mock/spc_5381.atom")
327 }}
328 end
329
330 def get("https://social.heldscal.la/api/statuses/user_timeline/23211.atom", _body, _headers) do
331 {:ok,
332 %Response{
333 status_code: 200,
334 body:
335 File.read!(
336 "test/fixtures/httpoison_mock/https___social.heldscal.la_api_statuses_user_timeline_23211.atom.xml"
337 )
338 }}
339 end
340
341 def get("https://mastodon.social/users/lambadalambda.atom", _body, _headers) do
342 {:ok,
343 %Response{
344 status_code: 200,
345 body:
346 File.read!(
347 "test/fixtures/httpoison_mock/https___mastodon.social_users_lambadalambda.atom"
348 )
349 }}
350 end
351
352 def get(
353 "https://social.stopwatchingus-heidelberg.de/api/statuses/user_timeline/18330.atom",
354 _body,
355 _headers
356 ) do
357 {:ok,
358 %Response{
359 status_code: 200,
360 body: File.read!("test/fixtures/httpoison_mock/atarifrosch_feed.xml")
361 }}
362 end
363
364 def get("https://pleroma.soykaf.com/users/lain/feed.atom", _body, _headers) do
365 {:ok,
366 %Response{
367 status_code: 200,
368 body:
369 File.read!(
370 "test/fixtures/httpoison_mock/https___pleroma.soykaf.com_users_lain_feed.atom.xml"
371 )
372 }}
373 end
374
375 def get("https://social.sakamoto.gq/users/eal/feed.atom", _body, _headers) do
376 {:ok,
377 %Response{
378 status_code: 200,
379 body: File.read!("test/fixtures/httpoison_mock/sakamoto_eal_feed.atom")
380 }}
381 end
382
383 def get("http://gs.example.org/index.php/api/statuses/user_timeline/1.atom", _body, _headers) do
384 {:ok,
385 %Response{
386 status_code: 200,
387 body:
388 File.read!(
389 "test/fixtures/httpoison_mock/http__gs.example.org_index.php_api_statuses_user_timeline_1.atom.xml"
390 )
391 }}
392 end
393
394 def get("https://shitposter.club/notice/2827873", _body, _headers) do
395 {:ok,
396 %Response{
397 status_code: 200,
398 body:
399 File.read!("test/fixtures/httpoison_mock/https___shitposter.club_notice_2827873.html")
400 }}
401 end
402
403 def get("https://shitposter.club/api/statuses/show/2827873.atom", _body, _headers) do
404 {:ok,
405 %Response{
406 status_code: 200,
407 body:
408 File.read!(
409 "test/fixtures/httpoison_mock/https___shitposter.club_api_statuses_show_2827873.atom.xml"
410 )
411 }}
412 end
413
414 def get("https://shitposter.club/api/statuses/user_timeline/1.atom", _body, _headers) do
415 {:ok,
416 %Response{
417 status_code: 200,
418 body:
419 File.read!(
420 "test/fixtures/httpoison_mock/https___shitposter.club_api_statuses_user_timeline_1.atom.xml"
421 )
422 }}
423 end
424
425 def post(
426 "https://social.heldscal.la/main/push/hub",
427 {:form, _data},
428 "Content-type": "application/x-www-form-urlencoded"
429 ) do
430 {:ok,
431 %Response{
432 status_code: 202
433 }}
434 end
435
436 def get("http://mastodon.example.org/users/admin/statuses/100787282858396771", _, _) do
437 {:ok,
438 %Response{
439 status_code: 200,
440 body:
441 File.read!(
442 "test/fixtures/httpoison_mock/http___mastodon.example.org_users_admin_status_1234.json"
443 )
444 }}
445 end
446
447 def get(
448 "https://pawoo.net/.well-known/webfinger",
449 [Accept: "application/xrd+xml,application/jrd+json"],
450 params: [resource: "https://pawoo.net/users/pekorino"],
451 follow_redirect: true
452 ) do
453 {:ok,
454 %Response{
455 status_code: 200,
456 body: File.read!("test/fixtures/httpoison_mock/https___pawoo.net_users_pekorino.xml")
457 }}
458 end
459
460 def get(
461 "https://pawoo.net/.well-known/webfinger?resource=https://pawoo.net/users/pekorino",
462 [Accept: "application/xrd+xml,application/jrd+json"],
463 follow_redirect: true
464 ) do
465 {:ok,
466 %Response{
467 status_code: 200,
468 body: File.read!("test/fixtures/httpoison_mock/https___pawoo.net_users_pekorino.xml")
469 }}
470 end
471
472 def get("https://pawoo.net/users/pekorino.atom", _, _) do
473 {:ok,
474 %Response{
475 status_code: 200,
476 body: File.read!("test/fixtures/httpoison_mock/https___pawoo.net_users_pekorino.atom")
477 }}
478 end
479
480 def get(
481 "https://mamot.fr/.well-known/webfinger",
482 [Accept: "application/xrd+xml,application/jrd+json"],
483 params: [resource: "https://mamot.fr/users/Skruyb"],
484 follow_redirect: true
485 ) do
486 {:ok,
487 %Response{
488 status_code: 200,
489 body: File.read!("test/fixtures/httpoison_mock/skruyb@mamot.fr.atom")
490 }}
491 end
492
493 def get(
494 "https://mamot.fr/.well-known/webfinger?resource=https://mamot.fr/users/Skruyb",
495 [Accept: "application/xrd+xml,application/jrd+json"],
496 follow_redirect: true
497 ) do
498 {:ok,
499 %Response{
500 status_code: 200,
501 body: File.read!("test/fixtures/httpoison_mock/skruyb@mamot.fr.atom")
502 }}
503 end
504
505 def get(
506 "https://social.sakamoto.gq/.well-known/webfinger",
507 [Accept: "application/xrd+xml,application/jrd+json"],
508 params: [resource: "https://social.sakamoto.gq/users/eal"],
509 follow_redirect: true
510 ) do
511 {:ok,
512 %Response{
513 status_code: 200,
514 body: File.read!("test/fixtures/httpoison_mock/eal_sakamoto.xml")
515 }}
516 end
517
518 def get(
519 "https://social.sakamoto.gq/.well-known/webfinger?resource=https://social.sakamoto.gq/users/eal",
520 [Accept: "application/xrd+xml,application/jrd+json"],
521 follow_redirect: true
522 ) do
523 {:ok,
524 %Response{
525 status_code: 200,
526 body: File.read!("test/fixtures/httpoison_mock/eal_sakamoto.xml")
527 }}
528 end
529
530 def get(
531 "https://pleroma.soykaf.com/.well-known/webfinger?resource=https://pleroma.soykaf.com/users/shp",
532 [Accept: "application/xrd+xml,application/jrd+json"],
533 follow_redirect: true
534 ) do
535 {:ok,
536 %Response{
537 status_code: 200,
538 body: File.read!("test/fixtures/httpoison_mock/shp@pleroma.soykaf.com.webfigner")
539 }}
540 end
541
542 def get(
543 "https://squeet.me/xrd/?uri=lain@squeet.me",
544 [Accept: "application/xrd+xml,application/jrd+json"],
545 follow_redirect: true
546 ) do
547 {:ok,
548 %Response{
549 status_code: 200,
550 body: File.read!("test/fixtures/httpoison_mock/lain_squeet.me_webfinger.xml")
551 }}
552 end
553
554 def get("https://mamot.fr/users/Skruyb.atom", _, _) do
555 {:ok,
556 %Response{
557 status_code: 200,
558 body: File.read!("test/fixtures/httpoison_mock/https___mamot.fr_users_Skruyb.atom")
559 }}
560 end
561
562 def get(
563 "https://social.sakamoto.gq/objects/0ccc1a2c-66b0-4305-b23a-7f7f2b040056",
564 [Accept: "application/atom+xml"],
565 _
566 ) do
567 {:ok,
568 %Response{
569 status_code: 200,
570 body: File.read!("test/fixtures/httpoison_mock/sakamoto.atom")
571 }}
572 end
573
574 def get("https://pleroma.soykaf.com/users/shp/feed.atom", _, _) do
575 {:ok,
576 %Response{
577 status_code: 200,
578 body: File.read!("test/fixtures/httpoison_mock/shp@pleroma.soykaf.com.feed")
579 }}
580 end
581
582 def get("http://social.heldscal.la/.well-known/host-meta", [], follow_redirect: true) do
583 {:ok,
584 %Response{
585 status_code: 200,
586 body: File.read!("test/fixtures/httpoison_mock/social.heldscal.la_host_meta")
587 }}
588 end
589
590 def get("http://status.alpicola.com/.well-known/host-meta", [], follow_redirect: true) do
591 {:ok,
592 %Response{
593 status_code: 200,
594 body: File.read!("test/fixtures/httpoison_mock/status.alpicola.com_host_meta")
595 }}
596 end
597
598 def get("http://macgirvin.com/.well-known/host-meta", [], follow_redirect: true) do
599 {:ok,
600 %Response{
601 status_code: 200,
602 body: File.read!("test/fixtures/httpoison_mock/macgirvin.com_host_meta")
603 }}
604 end
605
606 def get("http://mastodon.social/.well-known/host-meta", [], follow_redirect: true) do
607 {:ok,
608 %Response{
609 status_code: 200,
610 body: File.read!("test/fixtures/httpoison_mock/mastodon.social_host_meta")
611 }}
612 end
613
614 def get("http://shitposter.club/.well-known/host-meta", [], follow_redirect: true) do
615 {:ok,
616 %Response{
617 status_code: 200,
618 body: File.read!("test/fixtures/httpoison_mock/shitposter.club_host_meta")
619 }}
620 end
621
622 def get("http://pleroma.soykaf.com/.well-known/host-meta", [], follow_redirect: true) do
623 {:ok,
624 %Response{
625 status_code: 200,
626 body: File.read!("test/fixtures/httpoison_mock/pleroma.soykaf.com_host_meta")
627 }}
628 end
629
630 def get("http://social.sakamoto.gq/.well-known/host-meta", [], follow_redirect: true) do
631 {:ok,
632 %Response{
633 status_code: 200,
634 body: File.read!("test/fixtures/httpoison_mock/social.sakamoto.gq_host_meta")
635 }}
636 end
637
638 def get("http://gs.example.org/.well-known/host-meta", [], follow_redirect: true) do
639 {:ok,
640 %Response{
641 status_code: 200,
642 body: File.read!("test/fixtures/httpoison_mock/gs.example.org_host_meta")
643 }}
644 end
645
646 def get("http://pawoo.net/.well-known/host-meta", [], follow_redirect: true) do
647 {:ok,
648 %Response{
649 status_code: 200,
650 body: File.read!("test/fixtures/httpoison_mock/pawoo.net_host_meta")
651 }}
652 end
653
654 def get("http://mamot.fr/.well-known/host-meta", [], follow_redirect: true) do
655 {:ok,
656 %Response{
657 status_code: 200,
658 body: File.read!("test/fixtures/httpoison_mock/mamot.fr_host_meta")
659 }}
660 end
661
662 def get("http://mastodon.xyz/.well-known/host-meta", [], follow_redirect: true) do
663 {:ok,
664 %Response{
665 status_code: 200,
666 body: File.read!("test/fixtures/httpoison_mock/mastodon.xyz_host_meta")
667 }}
668 end
669
670 def get("http://social.wxcafe.net/.well-known/host-meta", [], follow_redirect: true) do
671 {:ok,
672 %Response{
673 status_code: 200,
674 body: File.read!("test/fixtures/httpoison_mock/social.wxcafe.net_host_meta")
675 }}
676 end
677
678 def get("http://squeet.me/.well-known/host-meta", [], follow_redirect: true) do
679 {:ok,
680 %Response{
681 status_code: 200,
682 body: File.read!("test/fixtures/httpoison_mock/squeet.me_host_meta")
683 }}
684 end
685
686 def get(
687 "http://social.stopwatchingus-heidelberg.de/.well-known/host-meta",
688 [],
689 follow_redirect: true
690 ) do
691 {:ok,
692 %Response{
693 status_code: 200,
694 body:
695 File.read!("test/fixtures/httpoison_mock/social.stopwatchingus-heidelberg.de_host_meta")
696 }}
697 end
698
699 def get("http://mastodon.example.org/users/admin", [Accept: "application/activity+json"], _) do
700 {:ok,
701 %Response{
702 status_code: 200,
703 body: File.read!("test/fixtures/httpoison_mock/admin@mastdon.example.org.json")
704 }}
705 end
706
707 def get(
708 "https://hubzilla.example.org/channel/kaniini",
709 [Accept: "application/activity+json"],
710 _
711 ) do
712 {:ok,
713 %Response{
714 status_code: 200,
715 body: File.read!("test/fixtures/httpoison_mock/kaniini@hubzilla.example.org.json")
716 }}
717 end
718
719 def get("https://masto.quad.moe/users/_HellPie", [Accept: "application/activity+json"], _) do
720 {:ok,
721 %Response{
722 status_code: 200,
723 body: File.read!("test/fixtures/httpoison_mock/hellpie.json")
724 }}
725 end
726
727 def get("https://niu.moe/users/rye", [Accept: "application/activity+json"], _) do
728 {:ok,
729 %Response{
730 status_code: 200,
731 body: File.read!("test/fixtures/httpoison_mock/rye.json")
732 }}
733 end
734
735 def get(
736 "https://mst3k.interlinked.me/users/luciferMysticus",
737 [Accept: "application/activity+json"],
738 _
739 ) do
740 {:ok,
741 %Response{
742 status_code: 200,
743 body: File.read!("test/fixtures/httpoison_mock/lucifermysticus.json")
744 }}
745 end
746
747 def get("https://mstdn.io/users/mayuutann", [Accept: "application/activity+json"], _) do
748 {:ok,
749 %Response{
750 status_code: 200,
751 body: File.read!("test/fixtures/httpoison_mock/mayumayu.json")
752 }}
753 end
754
755 def get(
756 "http://mastodon.example.org/@admin/99541947525187367",
757 [Accept: "application/activity+json"],
758 _
759 ) do
760 {:ok,
761 %Response{
762 status_code: 200,
763 body: File.read!("test/fixtures/mastodon-note-object.json")
764 }}
765 end
766
767 def get(
768 "https://mstdn.io/users/mayuutann/statuses/99568293732299394",
769 [Accept: "application/activity+json"],
770 _
771 ) do
772 {:ok,
773 %Response{
774 status_code: 200,
775 body: File.read!("test/fixtures/httpoison_mock/mayumayupost.json")
776 }}
777 end
778
779 def get("https://shitposter.club/notice/7369654", _, _) do
780 {:ok,
781 %Response{
782 status_code: 200,
783 body: File.read!("test/fixtures/httpoison_mock/7369654.html")
784 }}
785 end
786
787 def get("https://shitposter.club/api/statuses/show/7369654.atom", _body, _headers) do
788 {:ok,
789 %Response{
790 status_code: 200,
791 body: File.read!("test/fixtures/httpoison_mock/7369654.atom")
792 }}
793 end
794
795 def get("https://baptiste.gelez.xyz/~/PlumeDevelopment/this-month-in-plume-june-2018/", _, _) do
796 {:ok,
797 %Response{
798 status_code: 200,
799 body: File.read!("test/fixtures/httpoison_mock/baptiste.gelex.xyz-article.json")
800 }}
801 end
802
803 def get("https://baptiste.gelez.xyz/@/BaptisteGelez", _, _) do
804 {:ok,
805 %Response{
806 status_code: 200,
807 body: File.read!("test/fixtures/httpoison_mock/baptiste.gelex.xyz-user.json")
808 }}
809 end
810
811 def get("https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3", _, _) do
812 {:ok,
813 %Response{
814 status_code: 200,
815 body: File.read!("test/fixtures/httpoison_mock/peertube.moe-vid.json")
816 }}
817 end
818
819 def get("https://peertube.moe/accounts/7even", _, _) do
820 {:ok,
821 %Response{
822 status_code: 200,
823 body: File.read!("test/fixtures/httpoison_mock/7even.json")
824 }}
825 end
826
827 def get(url, body, headers) do
828 {:error,
829 "Not implemented the mock response for get #{inspect(url)}, #{inspect(body)}, #{
830 inspect(headers)
831 }"}
832 end
833
834 def post(url, _body, _headers) do
835 {:error, "Not implemented the mock response for post #{inspect(url)}"}
836 end
837
838 def post(url, _body, _headers, _options) do
839 {:error, "Not implemented the mock response for post #{inspect(url)}"}
840 end
841 end