Skip to content

Commit ec50570

Browse files
committed
Add mocks
1 parent f4404b5 commit ec50570

12 files changed

Lines changed: 559 additions & 24 deletions

File tree

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeFeedExtractorTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import org.junit.Test;
55
import org.schabi.newpipe.downloader.DownloaderFactory;
66
import org.schabi.newpipe.extractor.NewPipe;
7-
import org.schabi.newpipe.extractor.exceptions.AccountTerminatedException;
87
import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException;
98
import org.schabi.newpipe.extractor.exceptions.ParsingException;
109
import org.schabi.newpipe.extractor.services.BaseListExtractorTest;

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/channel/notAvailable/generated_mock_0.json

Lines changed: 7 additions & 4 deletions
Large diffs are not rendered by default.

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/channel/notAvailable/generated_mock_1.json

Lines changed: 9 additions & 6 deletions
Large diffs are not rendered by default.

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/channel/notAvailable/generated_mock_2.json

Lines changed: 17 additions & 7 deletions
Large diffs are not rendered by default.

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/channel/notAvailable/generated_mock_3.json

Lines changed: 81 additions & 0 deletions
Large diffs are not rendered by default.

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/channel/notAvailable/generated_mock_4.json

Lines changed: 81 additions & 0 deletions
Large diffs are not rendered by default.

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/channel/notAvailable/generated_mock_5.json

Lines changed: 81 additions & 0 deletions
Large diffs are not rendered by default.

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/channel/notAvailable/generated_mock_6.json

Lines changed: 81 additions & 0 deletions
Large diffs are not rendered by default.

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/channel/notAvailable/generated_mock_7.json

Lines changed: 81 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"request": {
3+
"httpMethod": "GET",
4+
"url": "https://www.youtube.com/channel/DOESNT-EXIST/videos?pbj\u003d1\u0026view\u003d0\u0026flow\u003dgrid",
5+
"headers": {
6+
"Accept-Language": [
7+
"en-GB, en;q\u003d0.9"
8+
],
9+
"Cookie": [
10+
"CONSENT\u003dPENDING+100406"
11+
],
12+
"X-YouTube-Client-Name": [
13+
"1"
14+
],
15+
"X-YouTube-Client-Version": [
16+
"2.20200214.04.00"
17+
]
18+
},
19+
"localization": {
20+
"languageCode": "en",
21+
"countryCode": "GB"
22+
}
23+
},
24+
"response": {
25+
"responseCode": 404,
26+
"responseMessage": "",
27+
"responseHeaders": {
28+
"alt-svc": [
29+
"h3-29\u003d\":443\"; ma\u003d2592000,h3-T051\u003d\":443\"; ma\u003d2592000,h3-Q050\u003d\":443\"; ma\u003d2592000,h3-Q046\u003d\":443\"; ma\u003d2592000,h3-Q043\u003d\":443\"; ma\u003d2592000,quic\u003d\":443\"; ma\u003d2592000; v\u003d\"46,43\""
30+
],
31+
"cache-control": [
32+
"no-cache, no-store, max-age\u003d0, must-revalidate"
33+
],
34+
"content-type": [
35+
"text/html; charset\u003dutf-8"
36+
],
37+
"date": [
38+
"Sat, 01 May 2021 15:47:25 GMT"
39+
],
40+
"expires": [
41+
"Mon, 01 Jan 1990 00:00:00 GMT"
42+
],
43+
"p3p": [
44+
"CP\u003d\"This is not a P3P policy! See http://support.google.com/accounts/answer/151657?hl\u003den-GB for more info.\""
45+
],
46+
"permissions-policy": [
47+
"ch-ua-full-version\u003d*, ch-ua-platform\u003d*, ch-ua-platform-version\u003d*, ch-ua-arch\u003d*, ch-ua-model\u003d*"
48+
],
49+
"pragma": [
50+
"no-cache"
51+
],
52+
"server": [
53+
"ESF"
54+
],
55+
"set-cookie": [
56+
"YSC\u003dgPx3EMoLzV4; Domain\u003d.youtube.com; Path\u003d/; Secure; HttpOnly; SameSite\u003dnone"
57+
],
58+
"strict-transport-security": [
59+
"max-age\u003d31536000"
60+
],
61+
"x-content-type-options": [
62+
"nosniff"
63+
],
64+
"x-frame-options": [
65+
"SAMEORIGIN"
66+
],
67+
"x-xss-protection": [
68+
"0"
69+
]
70+
},
71+
"responseBody": "\u003chtml lang\u003d\"en-GB\" dir\u003d\"ltr\"\u003e\u003chead\u003e\u003ctitle\u003e404 Not Found\u003c/title\u003e\u003cstyle nonce\u003d\"J6HBrtOLDsO+k15HZ0o11w\"\u003e*{margin:0;padding:0;border:0}html,body{height:100%;}\u003c/style\u003e\u003clink rel\u003d\"shortcut icon\" href\u003d\"https://www.youtube.com/img/favicon.ico\" type\u003d\"image/x-icon\"\u003e\u003clink rel\u003d\"icon\" href\u003d\"https://www.youtube.com/img/favicon_32.png\" sizes\u003d\"32x32\"\u003e\u003clink rel\u003d\"icon\" href\u003d\"https://www.youtube.com/img/favicon_48.png\" sizes\u003d\"48x48\"\u003e\u003clink rel\u003d\"icon\" href\u003d\"https://www.youtube.com/img/favicon_96.png\" sizes\u003d\"96x96\"\u003e\u003clink rel\u003d\"icon\" href\u003d\"https://www.youtube.com/img/favicon_144.png\" sizes\u003d\"144x144\"\u003e\u003c/head\u003e\u003cbody\u003e\u003ciframe style\u003d\"display:block;border:0;\" src\u003d\"/error?src\u003d404\u0026amp;ifr\u003d1\u0026amp;error\u003d\" width\u003d\"100%\" height\u003d\"100%\" frameborder\u003d\"\\\" scrolling\u003d\"no\"\u003e\u003c/iframe\u003e\u003c/body\u003e\u003c/html\u003e",
72+
"latestUrl": "https://www.youtube.com/channel/DOESNT-EXIST/videos?pbj\u003d1\u0026view\u003d0\u0026flow\u003dgrid"
73+
}
74+
}

0 commit comments

Comments
 (0)