Skip to content

Commit e147867

Browse files
Add tests
1 parent 5ab6cd7 commit e147867

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import static org.junit.jupiter.api.Assertions.assertFalse;
55
import static org.junit.jupiter.api.Assertions.assertThrows;
66
import static org.junit.jupiter.api.Assertions.assertTrue;
7+
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertContains;
78
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
89
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
910
import static org.schabi.newpipe.extractor.services.DefaultTests.assertNoMoreItems;
@@ -163,6 +164,12 @@ public void testUploaderVerified() throws Exception {
163164
void getPlaylistType() throws ParsingException {
164165
assertEquals(PlaylistInfo.PlaylistType.NORMAL, extractor.getPlaylistType());
165166
}
167+
168+
@Test
169+
public void testDescription() throws ParsingException {
170+
final String description = extractor.getDescription();
171+
assertContains("pop songs list", description);
172+
}
166173
}
167174

168175
public static class HugePlaylist implements BasePlaylistExtractorTest {
@@ -286,6 +293,12 @@ public void testUploaderVerified() throws Exception {
286293
void getPlaylistType() throws ParsingException {
287294
assertEquals(PlaylistInfo.PlaylistType.NORMAL, extractor.getPlaylistType());
288295
}
296+
297+
@Test
298+
public void testDescription() throws ParsingException {
299+
final String description = extractor.getDescription();
300+
assertContains("I Wanna Rock Super Gigantic Playlist", description);
301+
}
289302
}
290303

291304
public static class LearningPlaylist implements BasePlaylistExtractorTest {
@@ -394,6 +407,12 @@ public void testUploaderVerified() throws Exception {
394407
void getPlaylistType() throws ParsingException {
395408
assertEquals(PlaylistInfo.PlaylistType.NORMAL, extractor.getPlaylistType());
396409
}
410+
411+
@Test
412+
public void testDescription() throws ParsingException {
413+
final String description = extractor.getDescription();
414+
assertContains("47 episodes", description);
415+
}
397416
}
398417

399418
public static class ContinuationsTests {

0 commit comments

Comments
 (0)