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