Skip to content

Commit 09ddb6a

Browse files
committed
[YouTube] Add MockOnly to method testing mixes in related items
1 parent 8201b3b commit 09ddb6a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/stream/YoutubeStreamExtractorRelatedMixTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.junit.jupiter.api.BeforeAll;
1212
import org.junit.jupiter.api.Test;
1313
import org.schabi.newpipe.downloader.DownloaderFactory;
14+
import org.schabi.newpipe.downloader.MockOnly;
1415
import org.schabi.newpipe.extractor.InfoItem;
1516
import org.schabi.newpipe.extractor.NewPipe;
1617
import org.schabi.newpipe.extractor.StreamingService;
@@ -42,7 +43,7 @@ public static void setUp() throws Exception {
4243
YoutubeParsingHelper.resetClientVersionAndKey();
4344
YoutubeParsingHelper.setNumberGenerator(new Random(1));
4445
YoutubeStreamExtractor.resetDeobfuscationCode();
45-
NewPipe.init(new DownloaderFactory().getDownloader(RESOURCE_PATH + "relatedMix"));
46+
NewPipe.init(DownloaderFactory.getDownloader(RESOURCE_PATH + "relatedMix"));
4647
extractor = YouTube.getStreamExtractor(URL);
4748
extractor.fetchPage();
4849
}
@@ -62,6 +63,7 @@ public static void setUp() throws Exception {
6263
return Arrays.asList("https://www.youtube.com/user/danielleviband/", "©");
6364
}
6465
@Override public boolean expectedUploaderVerified() { return true; }
66+
@Override public long expectedUploaderSubscriberCountAtLeast() { return 32_000_000; }
6567
@Override public long expectedLength() { return 208; }
6668
@Override public long expectedTimestamp() { return 0; }
6769
@Override public long expectedViewCountAtLeast() { return 449_000_000; }
@@ -86,6 +88,7 @@ public static void setUp() throws Exception {
8688
// @formatter:on
8789

8890
@Test
91+
@MockOnly // related items keep changing, and so do the mixes contained within them
8992
@Override
9093
public void testRelatedItems() throws Exception {
9194
super.testRelatedItems();

0 commit comments

Comments
 (0)