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