[YouTube] Also test playlist type in playlist tests
This commit is contained in:
parent
401082abe4
commit
d660c04838
2 changed files with 38 additions and 2 deletions
|
@ -2,7 +2,6 @@ package org.schabi.newpipe.extractor.services.youtube;
|
||||||
|
|
||||||
import com.grack.nanojson.JsonWriter;
|
import com.grack.nanojson.JsonWriter;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Disabled;
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.schabi.newpipe.downloader.DownloaderFactory;
|
import org.schabi.newpipe.downloader.DownloaderFactory;
|
||||||
import org.schabi.newpipe.extractor.ExtractorAsserts;
|
import org.schabi.newpipe.extractor.ExtractorAsserts;
|
||||||
|
@ -11,6 +10,8 @@ import org.schabi.newpipe.extractor.ListExtractor.InfoItemsPage;
|
||||||
import org.schabi.newpipe.extractor.NewPipe;
|
import org.schabi.newpipe.extractor.NewPipe;
|
||||||
import org.schabi.newpipe.extractor.Page;
|
import org.schabi.newpipe.extractor.Page;
|
||||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||||
|
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||||
|
import org.schabi.newpipe.extractor.playlist.PlaylistInfo;
|
||||||
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeMixPlaylistExtractor;
|
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeMixPlaylistExtractor;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||||
|
|
||||||
|
@ -118,6 +119,11 @@ public class YoutubeMixPlaylistExtractorTest {
|
||||||
void getStreamCount() {
|
void getStreamCount() {
|
||||||
assertEquals(ListExtractor.ITEM_COUNT_INFINITE, extractor.getStreamCount());
|
assertEquals(ListExtractor.ITEM_COUNT_INFINITE, extractor.getStreamCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getPlaylistType() throws ParsingException {
|
||||||
|
assertEquals(PlaylistInfo.PlaylistType.MIX_STREAM, extractor.getPlaylistType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MixWithIndex {
|
public static class MixWithIndex {
|
||||||
|
@ -203,6 +209,11 @@ public class YoutubeMixPlaylistExtractorTest {
|
||||||
void getStreamCount() {
|
void getStreamCount() {
|
||||||
assertEquals(ListExtractor.ITEM_COUNT_INFINITE, extractor.getStreamCount());
|
assertEquals(ListExtractor.ITEM_COUNT_INFINITE, extractor.getStreamCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getPlaylistType() throws ParsingException {
|
||||||
|
assertEquals(PlaylistInfo.PlaylistType.MIX_STREAM, extractor.getPlaylistType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MyMix {
|
public static class MyMix {
|
||||||
|
@ -287,6 +298,11 @@ public class YoutubeMixPlaylistExtractorTest {
|
||||||
void getStreamCount() {
|
void getStreamCount() {
|
||||||
assertEquals(ListExtractor.ITEM_COUNT_INFINITE, extractor.getStreamCount());
|
assertEquals(ListExtractor.ITEM_COUNT_INFINITE, extractor.getStreamCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getPlaylistType() throws ParsingException {
|
||||||
|
assertEquals(PlaylistInfo.PlaylistType.MIX_STREAM, extractor.getPlaylistType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Invalid {
|
public static class Invalid {
|
||||||
|
@ -381,5 +397,10 @@ public class YoutubeMixPlaylistExtractorTest {
|
||||||
void getStreamCount() {
|
void getStreamCount() {
|
||||||
assertEquals(ListExtractor.ITEM_COUNT_INFINITE, extractor.getStreamCount());
|
assertEquals(ListExtractor.ITEM_COUNT_INFINITE, extractor.getStreamCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getPlaylistType() throws ParsingException {
|
||||||
|
assertEquals(PlaylistInfo.PlaylistType.MIX_CHANNEL, extractor.getPlaylistType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,9 @@ import org.schabi.newpipe.extractor.ExtractorAsserts;
|
||||||
import org.schabi.newpipe.extractor.ListExtractor;
|
import org.schabi.newpipe.extractor.ListExtractor;
|
||||||
import org.schabi.newpipe.extractor.NewPipe;
|
import org.schabi.newpipe.extractor.NewPipe;
|
||||||
import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException;
|
import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException;
|
||||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
|
||||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||||
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
||||||
|
import org.schabi.newpipe.extractor.playlist.PlaylistInfo;
|
||||||
import org.schabi.newpipe.extractor.services.BasePlaylistExtractorTest;
|
import org.schabi.newpipe.extractor.services.BasePlaylistExtractorTest;
|
||||||
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubePlaylistExtractor;
|
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubePlaylistExtractor;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||||
|
@ -162,6 +162,11 @@ public class YoutubePlaylistExtractorTest {
|
||||||
public void testUploaderVerified() throws Exception {
|
public void testUploaderVerified() throws Exception {
|
||||||
assertFalse(extractor.isUploaderVerified());
|
assertFalse(extractor.isUploaderVerified());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getPlaylistType() throws ParsingException {
|
||||||
|
assertEquals(PlaylistInfo.PlaylistType.NORMAL, extractor.getPlaylistType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class HugePlaylist implements BasePlaylistExtractorTest {
|
public static class HugePlaylist implements BasePlaylistExtractorTest {
|
||||||
|
@ -281,6 +286,11 @@ public class YoutubePlaylistExtractorTest {
|
||||||
public void testUploaderVerified() throws Exception {
|
public void testUploaderVerified() throws Exception {
|
||||||
assertTrue(extractor.isUploaderVerified());
|
assertTrue(extractor.isUploaderVerified());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getPlaylistType() throws ParsingException {
|
||||||
|
assertEquals(PlaylistInfo.PlaylistType.NORMAL, extractor.getPlaylistType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class LearningPlaylist implements BasePlaylistExtractorTest {
|
public static class LearningPlaylist implements BasePlaylistExtractorTest {
|
||||||
|
@ -386,6 +396,11 @@ public class YoutubePlaylistExtractorTest {
|
||||||
public void testUploaderVerified() throws Exception {
|
public void testUploaderVerified() throws Exception {
|
||||||
assertTrue(extractor.isUploaderVerified());
|
assertTrue(extractor.isUploaderVerified());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void getPlaylistType() throws ParsingException {
|
||||||
|
assertEquals(PlaylistInfo.PlaylistType.NORMAL, extractor.getPlaylistType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ContinuationsTests {
|
public static class ContinuationsTests {
|
||||||
|
|
Loading…
Reference in a new issue