d8b79abef9e2db524c53e922e7aefb51eb9a4098
[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("http://mastodon.example.org/users/admin/statuses/100787282858396771", _, _) do
408 {:ok,
409 %Response{
410 status_code: 200,
411 body:
412 File.read!(
413 "test/fixtures/httpoison_mock/http___mastodon.example.org_users_admin_status_1234.json"
414 )
415 }}
416 end
417
418 def get(
419 "https://pawoo.net/.well-known/webfinger",
420 [Accept: "application/xrd+xml,application/jrd+json"],
421 params: [resource: "https://pawoo.net/users/pekorino"],
422 follow_redirect: true
423 ) do
424 {:ok,
425 %Response{
426 status_code: 200,
427 body: File.read!("test/fixtures/httpoison_mock/https___pawoo.net_users_pekorino.xml")
428 }}
429 end
430
431 def get(
432 "https://pawoo.net/.well-known/webfinger?resource=https://pawoo.net/users/pekorino",
433 [Accept: "application/xrd+xml,application/jrd+json"],
434 follow_redirect: true
435 ) do
436 {:ok,
437 %Response{
438 status_code: 200,
439 body: File.read!("test/fixtures/httpoison_mock/https___pawoo.net_users_pekorino.xml")
440 }}
441 end
442
443 def get("https://pawoo.net/users/pekorino.atom", _, _) do
444 {:ok,
445 %Response{
446 status_code: 200,
447 body: File.read!("test/fixtures/httpoison_mock/https___pawoo.net_users_pekorino.atom")
448 }}
449 end
450
451 def get(
452 "https://mamot.fr/.well-known/webfinger",
453 [Accept: "application/xrd+xml,application/jrd+json"],
454 params: [resource: "https://mamot.fr/users/Skruyb"],
455 follow_redirect: true
456 ) do
457 {:ok,
458 %Response{
459 status_code: 200,
460 body: File.read!("test/fixtures/httpoison_mock/skruyb@mamot.fr.atom")
461 }}
462 end
463
464 def get(
465 "https://mamot.fr/.well-known/webfinger?resource=https://mamot.fr/users/Skruyb",
466 [Accept: "application/xrd+xml,application/jrd+json"],
467 follow_redirect: true
468 ) do
469 {:ok,
470 %Response{
471 status_code: 200,
472 body: File.read!("test/fixtures/httpoison_mock/skruyb@mamot.fr.atom")
473 }}
474 end
475
476 def get(
477 "https://social.sakamoto.gq/.well-known/webfinger",
478 [Accept: "application/xrd+xml,application/jrd+json"],
479 params: [resource: "https://social.sakamoto.gq/users/eal"],
480 follow_redirect: true
481 ) do
482 {:ok,
483 %Response{
484 status_code: 200,
485 body: File.read!("test/fixtures/httpoison_mock/eal_sakamoto.xml")
486 }}
487 end
488
489 def get(
490 "https://social.sakamoto.gq/.well-known/webfinger?resource=https://social.sakamoto.gq/users/eal",
491 [Accept: "application/xrd+xml,application/jrd+json"],
492 follow_redirect: true
493 ) do
494 {:ok,
495 %Response{
496 status_code: 200,
497 body: File.read!("test/fixtures/httpoison_mock/eal_sakamoto.xml")
498 }}
499 end
500
501 def get(
502 "https://pleroma.soykaf.com/.well-known/webfinger?resource=https://pleroma.soykaf.com/users/shp",
503 [Accept: "application/xrd+xml,application/jrd+json"],
504 follow_redirect: true
505 ) do
506 {:ok,
507 %Response{
508 status_code: 200,
509 body: File.read!("test/fixtures/httpoison_mock/shp@pleroma.soykaf.com.webfigner")
510 }}
511 end
512
513 def get(
514 "https://squeet.me/xrd/?uri=lain@squeet.me",
515 [Accept: "application/xrd+xml,application/jrd+json"],
516 follow_redirect: true
517 ) do
518 {:ok,
519 %Response{
520 status_code: 200,
521 body: File.read!("test/fixtures/httpoison_mock/lain_squeet.me_webfinger.xml")
522 }}
523 end
524
525 def get("https://mamot.fr/users/Skruyb.atom", _, _) do
526 {:ok,
527 %Response{
528 status_code: 200,
529 body: File.read!("test/fixtures/httpoison_mock/https___mamot.fr_users_Skruyb.atom")
530 }}
531 end
532
533 def get(
534 "https://social.sakamoto.gq/objects/0ccc1a2c-66b0-4305-b23a-7f7f2b040056",
535 [Accept: "application/atom+xml"],
536 _
537 ) do
538 {:ok,
539 %Response{
540 status_code: 200,
541 body: File.read!("test/fixtures/httpoison_mock/sakamoto.atom")
542 }}
543 end
544
545 def get("https://pleroma.soykaf.com/users/shp/feed.atom", _, _) do
546 {:ok,
547 %Response{
548 status_code: 200,
549 body: File.read!("test/fixtures/httpoison_mock/shp@pleroma.soykaf.com.feed")
550 }}
551 end
552
553 def get("http://social.heldscal.la/.well-known/host-meta", [], follow_redirect: true) do
554 {:ok,
555 %Response{
556 status_code: 200,
557 body: File.read!("test/fixtures/httpoison_mock/social.heldscal.la_host_meta")
558 }}
559 end
560
561 def get("http://status.alpicola.com/.well-known/host-meta", [], follow_redirect: true) do
562 {:ok,
563 %Response{
564 status_code: 200,
565 body: File.read!("test/fixtures/httpoison_mock/status.alpicola.com_host_meta")
566 }}
567 end
568
569 def get("http://macgirvin.com/.well-known/host-meta", [], follow_redirect: true) do
570 {:ok,
571 %Response{
572 status_code: 200,
573 body: File.read!("test/fixtures/httpoison_mock/macgirvin.com_host_meta")
574 }}
575 end
576
577 def get("http://mastodon.social/.well-known/host-meta", [], follow_redirect: true) do
578 {:ok,
579 %Response{
580 status_code: 200,
581 body: File.read!("test/fixtures/httpoison_mock/mastodon.social_host_meta")
582 }}
583 end
584
585 def get("http://shitposter.club/.well-known/host-meta", [], follow_redirect: true) do
586 {:ok,
587 %Response{
588 status_code: 200,
589 body: File.read!("test/fixtures/httpoison_mock/shitposter.club_host_meta")
590 }}
591 end
592
593 def get("http://pleroma.soykaf.com/.well-known/host-meta", [], follow_redirect: true) do
594 {:ok,
595 %Response{
596 status_code: 200,
597 body: File.read!("test/fixtures/httpoison_mock/pleroma.soykaf.com_host_meta")
598 }}
599 end
600
601 def get("http://social.sakamoto.gq/.well-known/host-meta", [], follow_redirect: true) do
602 {:ok,
603 %Response{
604 status_code: 200,
605 body: File.read!("test/fixtures/httpoison_mock/social.sakamoto.gq_host_meta")
606 }}
607 end
608
609 def get("http://gs.example.org/.well-known/host-meta", [], follow_redirect: true) do
610 {:ok,
611 %Response{
612 status_code: 200,
613 body: File.read!("test/fixtures/httpoison_mock/gs.example.org_host_meta")
614 }}
615 end
616
617 def get("http://pawoo.net/.well-known/host-meta", [], follow_redirect: true) do
618 {:ok,
619 %Response{
620 status_code: 200,
621 body: File.read!("test/fixtures/httpoison_mock/pawoo.net_host_meta")
622 }}
623 end
624
625 def get("http://mamot.fr/.well-known/host-meta", [], follow_redirect: true) do
626 {:ok,
627 %Response{
628 status_code: 200,
629 body: File.read!("test/fixtures/httpoison_mock/mamot.fr_host_meta")
630 }}
631 end
632
633 def get("http://mastodon.xyz/.well-known/host-meta", [], follow_redirect: true) do
634 {:ok,
635 %Response{
636 status_code: 200,
637 body: File.read!("test/fixtures/httpoison_mock/mastodon.xyz_host_meta")
638 }}
639 end
640
641 def get("http://social.wxcafe.net/.well-known/host-meta", [], follow_redirect: true) do
642 {:ok,
643 %Response{
644 status_code: 200,
645 body: File.read!("test/fixtures/httpoison_mock/social.wxcafe.net_host_meta")
646 }}
647 end
648
649 def get("http://squeet.me/.well-known/host-meta", [], follow_redirect: true) do
650 {:ok,
651 %Response{
652 status_code: 200,
653 body: File.read!("test/fixtures/httpoison_mock/squeet.me_host_meta")
654 }}
655 end
656
657 def get(
658 "http://social.stopwatchingus-heidelberg.de/.well-known/host-meta",
659 [],
660 follow_redirect: true
661 ) do
662 {:ok,
663 %Response{
664 status_code: 200,
665 body:
666 File.read!("test/fixtures/httpoison_mock/social.stopwatchingus-heidelberg.de_host_meta")
667 }}
668 end
669
670 def get("http://mastodon.example.org/users/admin", [Accept: "application/activity+json"], _) do
671 {:ok,
672 %Response{
673 status_code: 200,
674 body: File.read!("test/fixtures/httpoison_mock/admin@mastdon.example.org.json")
675 }}
676 end
677
678 def get(
679 "https://hubzilla.example.org/channel/kaniini",
680 [Accept: "application/activity+json"],
681 _
682 ) do
683 {:ok,
684 %Response{
685 status_code: 200,
686 body: File.read!("test/fixtures/httpoison_mock/kaniini@hubzilla.example.org.json")
687 }}
688 end
689
690 def get("https://masto.quad.moe/users/_HellPie", [Accept: "application/activity+json"], _) do
691 {:ok,
692 %Response{
693 status_code: 200,
694 body: File.read!("test/fixtures/httpoison_mock/hellpie.json")
695 }}
696 end
697
698 def get("https://niu.moe/users/rye", [Accept: "application/activity+json"], _) do
699 {:ok,
700 %Response{
701 status_code: 200,
702 body: File.read!("test/fixtures/httpoison_mock/rye.json")
703 }}
704 end
705
706 def get(
707 "https://mst3k.interlinked.me/users/luciferMysticus",
708 [Accept: "application/activity+json"],
709 _
710 ) do
711 {:ok,
712 %Response{
713 status_code: 200,
714 body: File.read!("test/fixtures/httpoison_mock/lucifermysticus.json")
715 }}
716 end
717
718 def get("https://mstdn.io/users/mayuutann", [Accept: "application/activity+json"], _) do
719 {:ok,
720 %Response{
721 status_code: 200,
722 body: File.read!("test/fixtures/httpoison_mock/mayumayu.json")
723 }}
724 end
725
726 def get(
727 "http://mastodon.example.org/@admin/99541947525187367",
728 [Accept: "application/activity+json"],
729 _
730 ) do
731 {:ok,
732 %Response{
733 status_code: 200,
734 body: File.read!("test/fixtures/mastodon-note-object.json")
735 }}
736 end
737
738 def get(
739 "https://mstdn.io/users/mayuutann/statuses/99568293732299394",
740 [Accept: "application/activity+json"],
741 _
742 ) do
743 {:ok,
744 %Response{
745 status_code: 200,
746 body: File.read!("test/fixtures/httpoison_mock/mayumayupost.json")
747 }}
748 end
749
750 def get("https://shitposter.club/notice/7369654", _, _) do
751 {:ok,
752 %Response{
753 status_code: 200,
754 body: File.read!("test/fixtures/httpoison_mock/7369654.html")
755 }}
756 end
757
758 def get("https://shitposter.club/api/statuses/show/7369654.atom", _body, _headers) do
759 {:ok,
760 %Response{
761 status_code: 200,
762 body: File.read!("test/fixtures/httpoison_mock/7369654.atom")
763 }}
764 end
765
766 def get("https://baptiste.gelez.xyz/~/PlumeDevelopment/this-month-in-plume-june-2018/", _, _) do
767 {:ok,
768 %Response{
769 status_code: 200,
770 body: File.read!("test/fixtures/httpoison_mock/baptiste.gelex.xyz-article.json")
771 }}
772 end
773
774 def get("https://baptiste.gelez.xyz/@/BaptisteGelez", _, _) do
775 {:ok,
776 %Response{
777 status_code: 200,
778 body: File.read!("test/fixtures/httpoison_mock/baptiste.gelex.xyz-user.json")
779 }}
780 end
781
782 def get("https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3", _, _) do
783 {:ok,
784 %Response{
785 status_code: 200,
786 body: File.read!("test/fixtures/httpoison_mock/peertube.moe-vid.json")
787 }}
788 end
789
790 def get("https://peertube.moe/accounts/7even", _, _) do
791 {:ok,
792 %Response{
793 status_code: 200,
794 body: File.read!("test/fixtures/httpoison_mock/7even.json")
795 }}
796 end
797
798 def get(url, body, headers) do
799 {:error,
800 "Not implemented the mock response for get #{inspect(url)}, #{inspect(body)}, #{
801 inspect(headers)
802 }"}
803 end
804
805 def post(url, _body, _headers) do
806 {:error, "Not implemented the mock response for post #{inspect(url)}"}
807 end
808
809 def post(url, _body, _headers, _options) do
810 {:error, "Not implemented the mock response for post #{inspect(url)}"}
811 end
812 end