Skip to content

Commit 3e4d2fd

Browse files
committed
Improve testChannelUrl()
1 parent bfe3eb1 commit 3e4d2fd

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeSearchExtractorChannelOnlyTest.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,18 @@ public void testChannelUrl() {
9292
if (item instanceof ChannelInfoItem) {
9393
ChannelInfoItem channel = (ChannelInfoItem) item;
9494

95-
if (channel.getSubscriberCount() > 5e7 && channel.getName().equals("PewDiePie")) { // the real PewDiePie
95+
if (channel.getSubscriberCount() > 1e8) { // the real PewDiePie
9696
assertEquals("https://www.youtube.com/channel/UC-lHJZR3Gqxm24_Vd_AJ5Yw", item.getUrl());
97-
} else {
98-
assertThat(item.getUrl(), CoreMatchers.startsWith("https://www.youtube.com/channel/"));
97+
break;
9998
}
10099
}
101100
}
101+
102+
for (InfoItem item : itemsPage.getItems()) {
103+
if (item instanceof ChannelInfoItem) {
104+
assertThat(item.getUrl(), CoreMatchers.startsWith("https://www.youtube.com/channel/"));
105+
}
106+
}
102107
}
103108

104109
@Test

0 commit comments

Comments
 (0)