Skip to content

Commit 79cc5c8

Browse files
committed
Fix tests of YoutubePlaylistExtractorTest and YoutubeMixPlaylistExtractorTest
Without removing RunWith and SuiteClasses annotations (and the corresponding imports) in YoutubePlaylistExtractorTest and YoutubeMixPlaylistExtractorTest, some mocks cannot be generated, so the CI fails because of the missing mocks. Mocks of workings tests have been also updated.
1 parent b74a39c commit 79cc5c8

25 files changed

Lines changed: 2813 additions & 1252 deletions

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,12 @@
55
import org.junit.BeforeClass;
66
import org.junit.Ignore;
77
import org.junit.Test;
8-
import org.junit.runner.RunWith;
9-
import org.junit.runners.Suite;
10-
import org.junit.runners.Suite.SuiteClasses;
118
import org.schabi.newpipe.downloader.DownloaderFactory;
129
import org.schabi.newpipe.extractor.ListExtractor;
1310
import org.schabi.newpipe.extractor.ListExtractor.InfoItemsPage;
1411
import org.schabi.newpipe.extractor.NewPipe;
1512
import org.schabi.newpipe.extractor.Page;
1613
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
17-
import org.schabi.newpipe.extractor.services.youtube.YoutubeMixPlaylistExtractorTest.ChannelMix;
18-
import org.schabi.newpipe.extractor.services.youtube.YoutubeMixPlaylistExtractorTest.Invalid;
19-
import org.schabi.newpipe.extractor.services.youtube.YoutubeMixPlaylistExtractorTest.Mix;
20-
import org.schabi.newpipe.extractor.services.youtube.YoutubeMixPlaylistExtractorTest.MixWithIndex;
21-
import org.schabi.newpipe.extractor.services.youtube.YoutubeMixPlaylistExtractorTest.MyMix;
2214
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeMixPlaylistExtractor;
2315
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
2416

@@ -36,8 +28,6 @@
3628
import static org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper.*;
3729
import static org.schabi.newpipe.extractor.utils.Utils.UTF_8;
3830

39-
@RunWith(Suite.class)
40-
@SuiteClasses({Mix.class, MixWithIndex.class, MyMix.class, Invalid.class, ChannelMix.class})
4131
public class YoutubeMixPlaylistExtractorTest {
4232

4333
private static final String VIDEO_ID = "_AzeUSL9lZc";

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,13 @@
33
import org.junit.BeforeClass;
44
import org.junit.Ignore;
55
import org.junit.Test;
6-
import org.junit.runner.RunWith;
7-
import org.junit.runners.Suite;
8-
import org.junit.runners.Suite.SuiteClasses;
96
import org.schabi.newpipe.downloader.DownloaderFactory;
107
import org.schabi.newpipe.extractor.ListExtractor;
118
import org.schabi.newpipe.extractor.NewPipe;
129
import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException;
1310
import org.schabi.newpipe.extractor.exceptions.ParsingException;
1411
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
1512
import org.schabi.newpipe.extractor.services.BasePlaylistExtractorTest;
16-
import org.schabi.newpipe.extractor.services.youtube.YoutubePlaylistExtractorTest.ContinuationsTests;
17-
import org.schabi.newpipe.extractor.services.youtube.YoutubePlaylistExtractorTest.HugePlaylist;
18-
import org.schabi.newpipe.extractor.services.youtube.YoutubePlaylistExtractorTest.LearningPlaylist;
19-
import org.schabi.newpipe.extractor.services.youtube.YoutubePlaylistExtractorTest.NotAvailable;
20-
import org.schabi.newpipe.extractor.services.youtube.YoutubePlaylistExtractorTest.TimelessPopHits;
2113
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubePlaylistExtractor;
2214
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
2315

@@ -38,9 +30,6 @@
3830
/**
3931
* Test for {@link YoutubePlaylistExtractor}
4032
*/
41-
@RunWith(Suite.class)
42-
@SuiteClasses({NotAvailable.class, TimelessPopHits.class, HugePlaylist.class,
43-
LearningPlaylist.class, ContinuationsTests.class})
4433
public class YoutubePlaylistExtractorTest {
4534

4635
private static final String RESOURCE_PATH = DownloaderFactory.RESOURCE_PATH + "services/youtube/extractor/playlist/";

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/mix/channelMix/generated_mock_0.json

Lines changed: 23 additions & 75 deletions
Large diffs are not rendered by default.

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/mix/channelMix/generated_mock_1.json

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

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/mix/channelMix/generated_mock_2.json

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

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/mix/invalid/generated_mock_0.json

Lines changed: 30 additions & 46 deletions
Large diffs are not rendered by default.
Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
{
2+
"request": {
3+
"httpMethod": "POST",
4+
"url": "https://www.youtube.com/youtubei/v1/next?key\u003dAIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8",
5+
"headers": {
6+
"Accept-Language": [
7+
"en-GB, en;q\u003d0.9"
8+
],
9+
"Origin": [
10+
"https://www.youtube.com"
11+
],
12+
"X-YouTube-Client-Name": [
13+
"1"
14+
],
15+
"Referer": [
16+
"https://www.youtube.com"
17+
],
18+
"X-YouTube-Client-Version": [
19+
"2.20210728.00.00"
20+
]
21+
},
22+
"dataToSend": [
23+
123,
24+
34,
25+
112,
26+
108,
27+
97,
28+
121,
29+
108,
30+
105,
31+
115,
32+
116,
33+
73,
34+
100,
35+
34,
36+
58,
37+
34,
38+
82,
39+
68,
40+
97,
41+
98,
42+
99,
43+
100,
44+
101,
45+
34,
46+
44,
47+
34,
48+
99,
49+
111,
50+
110,
51+
116,
52+
101,
53+
120,
54+
116,
55+
34,
56+
58,
57+
123,
58+
34,
59+
99,
60+
108,
61+
105,
62+
101,
63+
110,
64+
116,
65+
34,
66+
58,
67+
123,
68+
34,
69+
104,
70+
108,
71+
34,
72+
58,
73+
34,
74+
101,
75+
110,
76+
45,
77+
71,
78+
66,
79+
34,
80+
44,
81+
34,
82+
103,
83+
108,
84+
34,
85+
58,
86+
34,
87+
71,
88+
66,
89+
34,
90+
44,
91+
34,
92+
99,
93+
108,
94+
105,
95+
101,
96+
110,
97+
116,
98+
78,
99+
97,
100+
109,
101+
101,
102+
34,
103+
58,
104+
34,
105+
87,
106+
69,
107+
66,
108+
34,
109+
44,
110+
34,
111+
99,
112+
108,
113+
105,
114+
101,
115+
110,
116+
116,
117+
86,
118+
101,
119+
114,
120+
115,
121+
105,
122+
111,
123+
110,
124+
34,
125+
58,
126+
34,
127+
50,
128+
46,
129+
50,
130+
48,
131+
50,
132+
49,
133+
48,
134+
55,
135+
50,
136+
56,
137+
46,
138+
48,
139+
48,
140+
46,
141+
48,
142+
48,
143+
34,
144+
125,
145+
44,
146+
34,
147+
117,
148+
115,
149+
101,
150+
114,
151+
34,
152+
58,
153+
123,
154+
34,
155+
108,
156+
111,
157+
99,
158+
107,
159+
101,
160+
100,
161+
83,
162+
97,
163+
102,
164+
101,
165+
116,
166+
121,
167+
77,
168+
111,
169+
100,
170+
101,
171+
34,
172+
58,
173+
102,
174+
97,
175+
108,
176+
115,
177+
101,
178+
125,
179+
125,
180+
44,
181+
34,
182+
118,
183+
105,
184+
100,
185+
101,
186+
111,
187+
73,
188+
100,
189+
34,
190+
58,
191+
34,
192+
97,
193+
98,
194+
99,
195+
100,
196+
101,
197+
34,
198+
125
199+
],
200+
"localization": {
201+
"languageCode": "en",
202+
"countryCode": "GB"
203+
}
204+
},
205+
"response": {
206+
"responseCode": 500,
207+
"responseMessage": "",
208+
"responseHeaders": {
209+
"alt-svc": [
210+
"h3\u003d\":443\"; ma\u003d2592000,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\""
211+
],
212+
"cache-control": [
213+
"private"
214+
],
215+
"content-type": [
216+
"application/json; charset\u003dUTF-8"
217+
],
218+
"date": [
219+
"Sun, 01 Aug 2021 15:15:10 GMT"
220+
],
221+
"server": [
222+
"ESF"
223+
],
224+
"vary": [
225+
"Origin",
226+
"X-Origin",
227+
"Referer"
228+
],
229+
"x-content-type-options": [
230+
"nosniff"
231+
],
232+
"x-frame-options": [
233+
"SAMEORIGIN"
234+
],
235+
"x-xss-protection": [
236+
"0"
237+
]
238+
},
239+
"responseBody": "{\n \"error\": {\n \"code\": 500,\n \"message\": \"Internal error encountered.\",\n \"errors\": [\n {\n \"message\": \"Internal error encountered.\",\n \"domain\": \"global\",\n \"reason\": \"backendError\"\n }\n ],\n \"status\": \"INTERNAL\"\n }\n}\n",
240+
"latestUrl": "https://www.youtube.com/youtubei/v1/next?key\u003dAIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8"
241+
}
242+
}

0 commit comments

Comments
 (0)