mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-29 00:10:35 +05:30
[MediaCCC] Implement link handlers and channels tabs and tags changes on tests
Co-authored-by: ThetaDev <t.testboy@gmail.com>
This commit is contained in:
parent
8baec04611
commit
d3801dd0e9
@ -4,6 +4,7 @@ import org.junit.jupiter.api.BeforeAll;
|
|||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.schabi.newpipe.downloader.DownloaderTestImpl;
|
import org.schabi.newpipe.downloader.DownloaderTestImpl;
|
||||||
import org.schabi.newpipe.extractor.NewPipe;
|
import org.schabi.newpipe.extractor.NewPipe;
|
||||||
|
import org.schabi.newpipe.extractor.channel.tabs.ChannelTabExtractor;
|
||||||
import org.schabi.newpipe.extractor.services.media_ccc.extractors.MediaCCCConferenceExtractor;
|
import org.schabi.newpipe.extractor.services.media_ccc.extractors.MediaCCCConferenceExtractor;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
@ -16,12 +17,16 @@ import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
|
|||||||
public class MediaCCCConferenceExtractorTest {
|
public class MediaCCCConferenceExtractorTest {
|
||||||
public static class FrOSCon2017 {
|
public static class FrOSCon2017 {
|
||||||
private static MediaCCCConferenceExtractor extractor;
|
private static MediaCCCConferenceExtractor extractor;
|
||||||
|
private static ChannelTabExtractor tabExtractor;
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void setUpClass() throws Exception {
|
public static void setUpClass() throws Exception {
|
||||||
NewPipe.init(DownloaderTestImpl.getInstance());
|
NewPipe.init(DownloaderTestImpl.getInstance());
|
||||||
extractor = (MediaCCCConferenceExtractor) MediaCCC.getChannelExtractor("https://media.ccc.de/c/froscon2017");
|
extractor = (MediaCCCConferenceExtractor) MediaCCC.getChannelExtractor("https://media.ccc.de/c/froscon2017");
|
||||||
extractor.fetchPage();
|
extractor.fetchPage();
|
||||||
|
|
||||||
|
tabExtractor = MediaCCC.getChannelTabExtractor(extractor.getTabs().get(0));
|
||||||
|
tabExtractor.fetchPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -46,18 +51,22 @@ public class MediaCCCConferenceExtractorTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetInitalPage() throws Exception {
|
public void testGetInitalPage() throws Exception {
|
||||||
assertEquals(97, extractor.getInitialPage().getItems().size());
|
assertEquals(97, tabExtractor.getInitialPage().getItems().size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Oscal2019 {
|
public static class Oscal2019 {
|
||||||
private static MediaCCCConferenceExtractor extractor;
|
private static MediaCCCConferenceExtractor extractor;
|
||||||
|
private static ChannelTabExtractor tabExtractor;
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void setUpClass() throws Exception {
|
public static void setUpClass() throws Exception {
|
||||||
NewPipe.init(DownloaderTestImpl.getInstance());
|
NewPipe.init(DownloaderTestImpl.getInstance());
|
||||||
extractor = (MediaCCCConferenceExtractor) MediaCCC.getChannelExtractor("https://media.ccc.de/c/oscal19");
|
extractor = (MediaCCCConferenceExtractor) MediaCCC.getChannelExtractor("https://media.ccc.de/c/oscal19");
|
||||||
extractor.fetchPage();
|
extractor.fetchPage();
|
||||||
|
|
||||||
|
tabExtractor = MediaCCC.getChannelTabExtractor(extractor.getTabs().get(0));
|
||||||
|
tabExtractor.fetchPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -82,7 +91,7 @@ public class MediaCCCConferenceExtractorTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetInitalPage() throws Exception {
|
public void testGetInitalPage() throws Exception {
|
||||||
assertTrue(extractor.getInitialPage().getItems().size() >= 21);
|
assertTrue(tabExtractor.getInitialPage().getItems().size() >= 21);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ public class MediaCCCConferenceLinkHandlerFactoryTest {
|
|||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void setUp() {
|
public static void setUp() {
|
||||||
linkHandler = new MediaCCCConferenceLinkHandlerFactory();
|
linkHandler = MediaCCCConferenceLinkHandlerFactory.getInstance();
|
||||||
NewPipe.init(DownloaderTestImpl.getInstance());
|
NewPipe.init(DownloaderTestImpl.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ public class MediaCCCStreamLinkHandlerFactoryTest {
|
|||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
public static void setUp() {
|
public static void setUp() {
|
||||||
linkHandler = new MediaCCCStreamLinkHandlerFactory();
|
linkHandler = MediaCCCStreamLinkHandlerFactory.getInstance();
|
||||||
NewPipe.init(DownloaderTestImpl.getInstance());
|
NewPipe.init(DownloaderTestImpl.getInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user