Skip to content

Commit 666b459

Browse files
committed
Fix test and update mocks.
1 parent f6d054e commit 666b459

5 files changed

Lines changed: 1176 additions & 3 deletions

File tree

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeCommentsExtractorTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ public static class RepliesTest {
315315
public static void setUp() throws Exception {
316316
YoutubeParsingHelper.resetClientVersionAndKey();
317317
YoutubeParsingHelper.setNumberGenerator(new Random(1));
318-
NewPipe.init(new DownloaderFactory().getDownloader(RESOURCE_PATH + "likes"));
318+
NewPipe.init(new DownloaderFactory().getDownloader(RESOURCE_PATH + "replies"));
319319
extractor = (YoutubeCommentsExtractor) YouTube
320320
.getCommentsExtractor(url);
321321
extractor.fetchPage();
@@ -327,9 +327,9 @@ public void testGetCommentsFirstReplies() throws IOException, ExtractionExceptio
327327

328328
DefaultTests.defaultTestListOfItems(YouTube, comments.getItems(), comments.getErrors());
329329

330-
CommentsInfoItem pinnedComment = comments.getItems().get(0);
330+
CommentsInfoItem firstComment = comments.getItems().get(0);
331331

332-
InfoItemsPage<CommentsInfoItem> replies = extractor.getPage(pinnedComment.getReplies());
332+
InfoItemsPage<CommentsInfoItem> replies = extractor.getPage(firstComment.getReplies());
333333

334334
assertEquals("First reply comment did not match", "Lol", replies.getItems().get(0).getCommentText());
335335
}

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/comments/replies/generated_mock_0.json

Lines changed: 217 additions & 0 deletions
Large diffs are not rendered by default.

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/comments/replies/generated_mock_1.json

Lines changed: 228 additions & 0 deletions
Large diffs are not rendered by default.

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/comments/replies/generated_mock_2.json

Lines changed: 306 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)