[MediaCCC] Add ChannelTabExtractorTest

pull/1148/head
Stypox 2023-12-30 22:53:51 +01:00
rodzic cc9ade962e
commit 137e924035
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4BDF1B40A49FDD23
2 zmienionych plików z 51 dodań i 1 usunięć

Wyświetl plik

@ -0,0 +1,49 @@
package org.schabi.newpipe.extractor.services.media_ccc;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.schabi.newpipe.downloader.DownloaderTestImpl;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.channel.tabs.ChannelTabExtractor;
import org.schabi.newpipe.extractor.channel.tabs.ChannelTabs;
/**
* Test that it is possible to create and use a channel tab extractor ({@link
* org.schabi.newpipe.extractor.services.media_ccc.extractors.MediaCCCChannelTabExtractor}) without
* passing through the conference extractor
*/
public class MediaCCCChannelTabExtractorTest {
public static class CCCamp2023 {
private static ChannelTabExtractor extractor;
@BeforeAll
public static void setUpClass() throws Exception {
NewPipe.init(DownloaderTestImpl.getInstance());
extractor = MediaCCC.getChannelTabExtractorFromId("camp2023", ChannelTabs.VIDEOS);
extractor.fetchPage();
}
@Test
void testName() {
assertEquals(ChannelTabs.VIDEOS, extractor.getName());
}
@Test
void testGetUrl() throws Exception {
assertEquals("https://media.ccc.de/c/camp2023", extractor.getUrl());
}
@Test
void testGetOriginalUrl() throws Exception {
assertEquals("https://media.ccc.de/c/camp2023", extractor.getOriginalUrl());
}
@Test
void testGetInitalPage() throws Exception {
assertEquals(177, extractor.getInitialPage().getItems().size());
}
}
}

Wyświetl plik

@ -13,7 +13,8 @@ import static org.schabi.newpipe.extractor.ExtractorAsserts.assertContainsImageU
import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
/**
* Test {@link MediaCCCConferenceExtractor}
* Test {@link MediaCCCConferenceExtractor} and {@link
* org.schabi.newpipe.extractor.services.media_ccc.extractors.MediaCCCChannelTabExtractor}
*/
public class MediaCCCConferenceExtractorTest {
public static class FrOSCon2017 {