|
9 | 9 | import org.schabi.newpipe.extractor.channel.tabs.ChannelTabExtractor; |
10 | 10 | import org.schabi.newpipe.extractor.channel.tabs.ChannelTabs; |
11 | 11 | import org.schabi.newpipe.extractor.exceptions.ExtractionException; |
12 | | -import org.schabi.newpipe.extractor.exceptions.ParsingException; |
13 | | -import org.schabi.newpipe.extractor.services.BaseListExtractorTest; |
14 | 12 | import org.schabi.newpipe.extractor.services.DefaultListExtractorTest; |
15 | 13 | import org.schabi.newpipe.extractor.services.soundcloud.extractors.SoundcloudChannelTabExtractor; |
16 | 14 |
|
17 | 15 | import java.io.IOException; |
18 | 16 |
|
19 | 17 | import static org.junit.jupiter.api.Assertions.assertEquals; |
20 | | -import static org.schabi.newpipe.extractor.ServiceList.PeerTube; |
21 | 18 | import static org.schabi.newpipe.extractor.ServiceList.SoundCloud; |
22 | 19 | import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestGetPageInNewExtractor; |
23 | | -import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestMoreItems; |
24 | | -import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestRelatedItems; |
25 | 20 |
|
26 | 21 | class SoundcloudChannelTabExtractorTest { |
27 | 22 |
|
@@ -94,4 +89,60 @@ static void setUp() throws IOException, ExtractionException { |
94 | 89 | @Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.PLAYLIST; } |
95 | 90 | @Override public boolean expectedHasMoreItems() { return true; } |
96 | 91 | } |
| 92 | + |
| 93 | + static class LikesOnlyTracks extends DefaultListExtractorTest<ChannelTabExtractor> { |
| 94 | + private static SoundcloudChannelTabExtractor extractor; |
| 95 | + |
| 96 | + @BeforeAll |
| 97 | + static void setUp() throws IOException, ExtractionException { |
| 98 | + NewPipe.init(DownloaderTestImpl.getInstance()); |
| 99 | + extractor = (SoundcloudChannelTabExtractor) SoundCloud |
| 100 | + .getChannelTabExtractorFromId("30854092", ChannelTabs.LIKES); |
| 101 | + extractor.fetchPage(); |
| 102 | + } |
| 103 | + |
| 104 | + @Override public ChannelTabExtractor extractor() throws Exception { return extractor; } |
| 105 | + @Override public StreamingService expectedService() throws Exception { return SoundCloud; } |
| 106 | + @Override public String expectedName() throws Exception { return ChannelTabs.LIKES; } |
| 107 | + @Override public String expectedId() throws Exception { return "30854092"; } |
| 108 | + @Override public String expectedUrlContains() throws Exception { return "https://soundcloud.com/lubenitza/likes"; } |
| 109 | + @Override public String expectedOriginalUrlContains() throws Exception { return "https://soundcloud.com/lubenitza/likes"; } |
| 110 | + @Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.STREAM; } |
| 111 | + @Override public boolean expectedHasMoreItems() { return true; } |
| 112 | + |
| 113 | + @Test |
| 114 | + void testGetPageInNewExtractor() throws Exception { |
| 115 | + final ChannelTabExtractor newTabExtractor = |
| 116 | + SoundCloud.getChannelTabExtractorFromId("30854092", ChannelTabs.LIKES); |
| 117 | + defaultTestGetPageInNewExtractor(extractor, newTabExtractor); |
| 118 | + } |
| 119 | + } |
| 120 | + |
| 121 | + static class LikesOnlyPlaylists extends DefaultListExtractorTest<ChannelTabExtractor> { |
| 122 | + private static SoundcloudChannelTabExtractor extractor; |
| 123 | + |
| 124 | + @BeforeAll |
| 125 | + static void setUp() throws IOException, ExtractionException { |
| 126 | + NewPipe.init(DownloaderTestImpl.getInstance()); |
| 127 | + extractor = (SoundcloudChannelTabExtractor) SoundCloud |
| 128 | + .getChannelTabExtractorFromId("1280839267", ChannelTabs.LIKES); |
| 129 | + extractor.fetchPage(); |
| 130 | + } |
| 131 | + |
| 132 | + @Override public ChannelTabExtractor extractor() throws Exception { return extractor; } |
| 133 | + @Override public StreamingService expectedService() throws Exception { return SoundCloud; } |
| 134 | + @Override public String expectedName() throws Exception { return ChannelTabs.LIKES; } |
| 135 | + @Override public String expectedId() throws Exception { return "1280839267"; } |
| 136 | + @Override public String expectedUrlContains() throws Exception { return "https://soundcloud.com/soreen-735855039/likes"; } |
| 137 | + @Override public String expectedOriginalUrlContains() throws Exception { return "https://soundcloud.com/soreen-735855039/likes"; } |
| 138 | + @Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.PLAYLIST; } |
| 139 | + @Override public boolean expectedHasMoreItems() { return true; } |
| 140 | + |
| 141 | + @Test |
| 142 | + void testGetPageInNewExtractor() throws Exception { |
| 143 | + final ChannelTabExtractor newTabExtractor = |
| 144 | + SoundCloud.getChannelTabExtractorFromId("1280839267", ChannelTabs.LIKES); |
| 145 | + defaultTestGetPageInNewExtractor(extractor, newTabExtractor); |
| 146 | + } |
| 147 | + } |
97 | 148 | } |
0 commit comments