Skip to content

Commit 137e924

Browse files
committed
[MediaCCC] Add ChannelTabExtractorTest
1 parent cc9ade9 commit 137e924

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package org.schabi.newpipe.extractor.services.media_ccc;
2+
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
5+
6+
import org.junit.jupiter.api.BeforeAll;
7+
import org.junit.jupiter.api.Test;
8+
import org.schabi.newpipe.downloader.DownloaderTestImpl;
9+
import org.schabi.newpipe.extractor.NewPipe;
10+
import org.schabi.newpipe.extractor.channel.tabs.ChannelTabExtractor;
11+
import org.schabi.newpipe.extractor.channel.tabs.ChannelTabs;
12+
13+
/**
14+
* Test that it is possible to create and use a channel tab extractor ({@link
15+
* org.schabi.newpipe.extractor.services.media_ccc.extractors.MediaCCCChannelTabExtractor}) without
16+
* passing through the conference extractor
17+
*/
18+
public class MediaCCCChannelTabExtractorTest {
19+
public static class CCCamp2023 {
20+
private static ChannelTabExtractor extractor;
21+
22+
@BeforeAll
23+
public static void setUpClass() throws Exception {
24+
NewPipe.init(DownloaderTestImpl.getInstance());
25+
extractor = MediaCCC.getChannelTabExtractorFromId("camp2023", ChannelTabs.VIDEOS);
26+
extractor.fetchPage();
27+
}
28+
29+
@Test
30+
void testName() {
31+
assertEquals(ChannelTabs.VIDEOS, extractor.getName());
32+
}
33+
34+
@Test
35+
void testGetUrl() throws Exception {
36+
assertEquals("https://media.ccc.de/c/camp2023", extractor.getUrl());
37+
}
38+
39+
@Test
40+
void testGetOriginalUrl() throws Exception {
41+
assertEquals("https://media.ccc.de/c/camp2023", extractor.getOriginalUrl());
42+
}
43+
44+
@Test
45+
void testGetInitalPage() throws Exception {
46+
assertEquals(177, extractor.getInitialPage().getItems().size());
47+
}
48+
}
49+
}

extractor/src/test/java/org/schabi/newpipe/extractor/services/media_ccc/MediaCCCConferenceExtractorTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
1414

1515
/**
16-
* Test {@link MediaCCCConferenceExtractor}
16+
* Test {@link MediaCCCConferenceExtractor} and {@link
17+
* org.schabi.newpipe.extractor.services.media_ccc.extractors.MediaCCCChannelTabExtractor}
1718
*/
1819
public class MediaCCCConferenceExtractorTest {
1920
public static class FrOSCon2017 {

0 commit comments

Comments
 (0)