From da198cf0215d33cac76d9fee2063f28652cb75f0 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Mon, 25 Jun 2018 17:27:32 -0400 Subject: [PATCH] Added unit test for Myhentaicomics quickQueue --- .../ripper/rippers/MyhentaicomicsRipperTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/MyhentaicomicsRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/MyhentaicomicsRipperTest.java index b4d01032..5e6cfc7e 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/MyhentaicomicsRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/MyhentaicomicsRipperTest.java @@ -21,4 +21,18 @@ public class MyhentaicomicsRipperTest extends RippersTest { // Test a tag assertEquals("2409", ripper.getGID(new URL("http://myhentaicomics.com/index.php/tag/2409/"))); } + + public void testGetAlbumsToQueue() throws IOException { + URL url = new URL("https://myhentaicomics.com/index.php/tag/3167/"); + MyhentaicomicsRipper ripper = new MyhentaicomicsRipper(url); + assertEquals(15, ripper.getAlbumsToQueue(ripper.getFirstPage()).size()); + } + + public void testPageContainsAlbums() throws IOException { + URL url = new URL("https://myhentaicomics.com/index.php/tag/3167/"); + URL url2 = new URL("https://myhentaicomics.com/index.php/search?q=test"); + MyhentaicomicsRipper ripper = new MyhentaicomicsRipper(url); + assertTrue(ripper.pageContainsAlbums(url)); + assertTrue(ripper.pageContainsAlbums(url2)); + } } \ No newline at end of file