Fix test and update mocks.
This commit is contained in:
parent
f6d054e5da
commit
666b45958e
5 changed files with 1176 additions and 3 deletions
|
@ -315,7 +315,7 @@ public class YoutubeCommentsExtractorTest {
|
||||||
public static void setUp() throws Exception {
|
public static void setUp() throws Exception {
|
||||||
YoutubeParsingHelper.resetClientVersionAndKey();
|
YoutubeParsingHelper.resetClientVersionAndKey();
|
||||||
YoutubeParsingHelper.setNumberGenerator(new Random(1));
|
YoutubeParsingHelper.setNumberGenerator(new Random(1));
|
||||||
NewPipe.init(new DownloaderFactory().getDownloader(RESOURCE_PATH + "likes"));
|
NewPipe.init(new DownloaderFactory().getDownloader(RESOURCE_PATH + "replies"));
|
||||||
extractor = (YoutubeCommentsExtractor) YouTube
|
extractor = (YoutubeCommentsExtractor) YouTube
|
||||||
.getCommentsExtractor(url);
|
.getCommentsExtractor(url);
|
||||||
extractor.fetchPage();
|
extractor.fetchPage();
|
||||||
|
@ -327,9 +327,9 @@ public class YoutubeCommentsExtractorTest {
|
||||||
|
|
||||||
DefaultTests.defaultTestListOfItems(YouTube, comments.getItems(), comments.getErrors());
|
DefaultTests.defaultTestListOfItems(YouTube, comments.getItems(), comments.getErrors());
|
||||||
|
|
||||||
CommentsInfoItem pinnedComment = comments.getItems().get(0);
|
CommentsInfoItem firstComment = comments.getItems().get(0);
|
||||||
|
|
||||||
InfoItemsPage<CommentsInfoItem> replies = extractor.getPage(pinnedComment.getReplies());
|
InfoItemsPage<CommentsInfoItem> replies = extractor.getPage(firstComment.getReplies());
|
||||||
|
|
||||||
assertEquals("First reply comment did not match", "Lol", replies.getItems().get(0).getCommentText());
|
assertEquals("First reply comment did not match", "Lol", replies.getItems().get(0).getCommentText());
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue