From 867ca1cabf0f1aac5c9d6b256898f2d07ac3a2bb Mon Sep 17 00:00:00 2001 From: Tobias Groza Date: Tue, 14 May 2019 22:11:40 +0200 Subject: [PATCH] Fix failing YouTube comments tests The comment function has been disabled for the video on which we ran the test. We are testing the comments of a different video now. --- .../youtube/YoutubeCommentsExtractorTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeCommentsExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeCommentsExtractorTest.java index a4bb6a61..6d22e4d6 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeCommentsExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeCommentsExtractorTest.java @@ -27,18 +27,18 @@ public class YoutubeCommentsExtractorTest { public static void setUp() throws Exception { NewPipe.init(Downloader.getInstance(), new Localization("GB", "en")); extractor = (YoutubeCommentsExtractor) YouTube - .getCommentsExtractor("https://www.youtube.com/watch?v=rrgFN3AxGfs"); + .getCommentsExtractor("https://www.youtube.com/watch?v=D00Au7k3i6o"); } @Test public void testGetComments() throws IOException, ExtractionException { - boolean result = false; + boolean result; InfoItemsPage comments = extractor.getInitialPage(); - result = findInComments(comments, "i should really be in the top comment.lol"); + result = findInComments(comments, "s1ck m3m3"); while (comments.hasNextPage() && !result) { comments = extractor.getPage(comments.getNextPageUrl()); - result = findInComments(comments, "i should really be in the top comment.lol"); + result = findInComments(comments, "s1ck m3m3"); } assertTrue(result); @@ -47,14 +47,14 @@ public class YoutubeCommentsExtractorTest { @Test public void testGetCommentsFromCommentsInfo() throws IOException, ExtractionException { boolean result = false; - CommentsInfo commentsInfo = CommentsInfo.getInfo("https://www.youtube.com/watch?v=rrgFN3AxGfs"); - assertTrue("what the fuck am i doing with my life.wmv".equals(commentsInfo.getName())); - result = findInComments(commentsInfo.getRelatedItems(), "i should really be in the top comment.lol"); + CommentsInfo commentsInfo = CommentsInfo.getInfo("https://www.youtube.com/watch?v=D00Au7k3i6o"); + assertTrue("what the fuck am i doing with my life".equals(commentsInfo.getName())); + result = findInComments(commentsInfo.getRelatedItems(), "s1ck m3m3"); String nextPage = commentsInfo.getNextPageUrl(); while (!StringUtil.isBlank(nextPage) && !result) { InfoItemsPage moreItems = CommentsInfo.getMoreItems(YouTube, commentsInfo, nextPage); - result = findInComments(moreItems.getItems(), "i should really be in the top comment.lol"); + result = findInComments(moreItems.getItems(), "s1ck m3m3"); nextPage = moreItems.getNextPageUrl(); }