From 7b71a7d3f5f80d35fd2c2bb0f674e257519c9a50 Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Thu, 19 Apr 2018 19:16:15 -0400 Subject: [PATCH] Extended some unit tests to include getGid --- .../tst/ripper/rippers/EightmusesRipperTest.java | 5 +++++ .../tst/ripper/rippers/ModelmayhemRipperTest.java | 5 +++++ .../tst/ripper/rippers/MyhentaicomicsRipperTest.java | 11 +++++++++++ 3 files changed, 21 insertions(+) diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/EightmusesRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/EightmusesRipperTest.java index 4a6c3539..e29c9ece 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/EightmusesRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/EightmusesRipperTest.java @@ -17,4 +17,9 @@ public class EightmusesRipperTest extends RippersTest { ripper = new EightmusesRipper(new URL("https://www.8muses.com/comix/album/Blacknwhitecomics_com-Comix/BlacknWhiteComics/The-Mayor")); testRipper(ripper); } + + public void testGID() throws IOException { + EightmusesRipper ripper = new EightmusesRipper(new URL("https://www.8muses.com/comix/album/Affect3D-Comics/TheDude3DX/Lust-Unleashed-The-Urge-To-Explore")); + assertEquals("Affect3D-Comics", ripper.getGID(new URL("https://www.8muses.com/comics/album/Affect3D-Comics/TheDude3DX/Lust-Unleashed-The-Urge-To-Explore"))); + } } \ No newline at end of file diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ModelmayhemRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ModelmayhemRipperTest.java index 621d77c3..d2a9581b 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ModelmayhemRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ModelmayhemRipperTest.java @@ -10,4 +10,9 @@ public class ModelmayhemRipperTest extends RippersTest { ModelmayhemRipper ripper = new ModelmayhemRipper(new URL("https://www.modelmayhem.com/portfolio/520206/viewall")); testRipper(ripper); } + + public void testGetGID() throws IOException { + ModelmayhemRipper ripper = new ModelmayhemRipper(new URL("https://www.modelmayhem.com/portfolio/520206/viewall")); + assertEquals("520206", ripper.getGID(new URL("https://www.modelmayhem.com/portfolio/520206/viewall"))); + } } 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 6714195d..b4d01032 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 @@ -10,4 +10,15 @@ public class MyhentaicomicsRipperTest extends RippersTest { MyhentaicomicsRipper ripper = new MyhentaicomicsRipper(new URL("http://myhentaicomics.com/index.php/Nienna-Lost-Tales")); testRipper(ripper); } + + public void testGetGID() throws IOException { + URL url = new URL("http://myhentaicomics.com/index.php/Nienna-Lost-Tales"); + MyhentaicomicsRipper ripper = new MyhentaicomicsRipper(url); + // Test a comic + assertEquals("Nienna-Lost-Tales", ripper.getGID(url)); + // Test a search + assertEquals("test", ripper.getGID(new URL("http://myhentaicomics.com/index.php/search?q=test"))); + // Test a tag + assertEquals("2409", ripper.getGID(new URL("http://myhentaicomics.com/index.php/tag/2409/"))); + } } \ No newline at end of file