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