From b63f8f16b9474e2023e23c9d51a296373daeebed Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Mon, 25 Jun 2018 06:03:10 -0400 Subject: [PATCH] Added unit test for erome --- .../tst/ripper/rippers/EromeRipperTest.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/test/java/com/rarchives/ripme/tst/ripper/rippers/EromeRipperTest.java diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/EromeRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/EromeRipperTest.java new file mode 100644 index 00000000..c07c41ac --- /dev/null +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/EromeRipperTest.java @@ -0,0 +1,40 @@ +package com.rarchives.ripme.tst.ripper.rippers; + +import java.io.IOException; +import java.net.URL; + +import com.rarchives.ripme.ripper.rippers.EromeRipper; + +public class EromeRipperTest extends RippersTest { + + public void testGetGIDProfilePage() throws IOException { + URL url = new URL("https://www.erome.com/Jay-Jenna"); + EromeRipper ripper = new EromeRipper(url); + assertEquals("Jay-Jenna", ripper.getGID(url)); + } + + public void testGetGIDAlbum() throws IOException { + URL url = new URL("https://www.erome.com/a/KbDAM1XT"); + EromeRipper ripper = new EromeRipper(url); + assertEquals("KbDAM1XT", ripper.getGID(url)); + } + + public void testGetAlbumsToQueue() throws IOException { + URL url = new URL("https://www.erome.com/Jay-Jenna"); + EromeRipper ripper = new EromeRipper(url); + assert(2 >= ripper.getAlbumsToQueue(ripper.getFirstPage()).size()); + } + + public void testPageContainsAlbums() throws IOException { + URL url = new URL("https://www.erome.com/Jay-Jenna"); + EromeRipper ripper = new EromeRipper(url); + assert(ripper.pageContainsAlbums(url)); + assert(!ripper.pageContainsAlbums(new URL("https://www.erome.com/a/KbDAM1XT"))); + } + + public void testRip() throws IOException { + URL url = new URL("https://www.erome.com/a/4FqeUxil"); + EromeRipper ripper = new EromeRipper(url); + testRipper(ripper); + } +}