Skip to content

Commit f9792cf

Browse files
committed
[YouTube] Fix InteractiveTabbedHeader.testTabs test
YouTube now returns a Shorts tab for InteractiveTabbedHeader gaming channels, which contains Shorts about the game of the topic channel but are not uploaded on the game topic channel. As this tab is already supported by the extractor, fetching a gaming topic channel now returns a tab instead of none. Channel name and channel URL of these Shorts needs to be set to null in a separate commit, as Shorts on this tab do not have the topic channel as their uploader.
1 parent f40fc0a commit f9792cf

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelExtractorTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.schabi.newpipe.extractor.exceptions.AccountTerminatedException;
2626
import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException;
2727
import org.schabi.newpipe.extractor.exceptions.ParsingException;
28+
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
2829
import org.schabi.newpipe.extractor.linkhandler.ReadyChannelTabListLinkHandler;
2930
import org.schabi.newpipe.extractor.services.BaseChannelExtractorTest;
3031
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeChannelExtractor;
@@ -916,8 +917,14 @@ public void testVerified() throws Exception {
916917
@Test
917918
@Override
918919
public void testTabs() throws Exception {
919-
// Gaming topic channels tabs are not yet supported, so an empty list should be returned
920-
assertTrue(extractor.getTabs().isEmpty());
920+
// Gaming topic channels tabs are not yet supported
921+
// However, a Shorts tab like on other channel types is returned, so it is supported
922+
// Check that it is returned
923+
final List<ListLinkHandler> channelTabs = extractor.getTabs();
924+
assertEquals(1, channelTabs.size());
925+
final List<String> contentFilters = channelTabs.get(0).getContentFilters();
926+
assertEquals(1, contentFilters.size());
927+
assertEquals(ChannelTabs.SHORTS, contentFilters.get(0));
921928
}
922929

923930
@Test

0 commit comments

Comments
 (0)