mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-27 15:30:34 +05:30
Add tests for ratings in yt stream extractor tests
This commit is contained in:
parent
1bb6cdee22
commit
7ba04836eb
@ -187,6 +187,18 @@ public class YoutubeStreamExtractorDefaultTest {
|
|||||||
// Video (/view?v=YQHsXMglC9A) set in the setUp() method has no captions => null
|
// Video (/view?v=YQHsXMglC9A) set in the setUp() method has no captions => null
|
||||||
assertTrue(extractor.getSubtitles(MediaFormat.TTML).isEmpty());
|
assertTrue(extractor.getSubtitles(MediaFormat.TTML).isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetLikeCount() throws ParsingException {
|
||||||
|
long likeCount = extractor.getLikeCount();
|
||||||
|
assertTrue("" + likeCount, likeCount >= 15000000);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetDislikeCount() throws ParsingException {
|
||||||
|
long dislikeCount = extractor.getDislikeCount();
|
||||||
|
assertTrue("" + dislikeCount, dislikeCount >= 818000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class DescriptionTestPewdiepie {
|
public static class DescriptionTestPewdiepie {
|
||||||
@ -249,6 +261,29 @@ public class YoutubeStreamExtractorDefaultTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class RatingsDisabledTest {
|
||||||
|
private static YoutubeStreamExtractor extractor;
|
||||||
|
|
||||||
|
@BeforeClass
|
||||||
|
public static void setUp() throws Exception {
|
||||||
|
NewPipe.init(DownloaderTestImpl.getInstance());
|
||||||
|
extractor = (YoutubeStreamExtractor) YouTube
|
||||||
|
.getStreamExtractor("https://www.youtube.com/watch?v=HRKu0cvrr_o");
|
||||||
|
extractor.fetchPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetLikeCount() throws ParsingException {
|
||||||
|
assertEquals(-1, extractor.getLikeCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetDislikeCount() throws ParsingException {
|
||||||
|
assertEquals(-1, extractor.getDislikeCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static class FramesTest {
|
public static class FramesTest {
|
||||||
private static YoutubeStreamExtractor extractor;
|
private static YoutubeStreamExtractor extractor;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user