Merge pull request #568 from cyian-1756/unit-tests

Added more unit tests
This commit is contained in:
cyian-1756 2018-05-19 12:02:12 -04:00 committed by GitHub
commit f8176a8143
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 55 additions and 1 deletions

View File

@ -469,4 +469,4 @@ public class DeviantartRipper extends AbstractHTMLRipper {
// We are logged in, save the cookies // We are logged in, save the cookies
return resp.cookies(); return resp.cookies();
} }
} }

View File

@ -16,4 +16,10 @@ public class DeviantartRipperTest extends RippersTest {
DeviantartRipper ripper = new DeviantartRipper(new URL("http://faterkcx.deviantart.com/gallery/")); DeviantartRipper ripper = new DeviantartRipper(new URL("http://faterkcx.deviantart.com/gallery/"));
testRipper(ripper); testRipper(ripper);
} }
public void testGetGID() throws IOException {
URL url = new URL("http://airgee.deviantart.com/gallery/");
DeviantartRipper ripper = new DeviantartRipper(url);
assertEquals("airgee", ripper.getGID(url));
}
} }

View File

@ -10,4 +10,10 @@ public class FuraffinityRipperTest extends RippersTest {
FuraffinityRipper ripper = new FuraffinityRipper(new URL("https://www.furaffinity.net/gallery/mustardgas/")); FuraffinityRipper ripper = new FuraffinityRipper(new URL("https://www.furaffinity.net/gallery/mustardgas/"));
testRipper(ripper); testRipper(ripper);
} }
public void testGetGID() throws IOException {
URL url = new URL("https://www.furaffinity.net/gallery/mustardgas/");
FuraffinityRipper ripper = new FuraffinityRipper(url);
assertEquals("mustardgas", ripper.getGID(url));
}
} }

View File

@ -10,4 +10,10 @@ public class GfycatporntubeRipperTest extends RippersTest {
GfycatporntubeRipper ripper = new GfycatporntubeRipper(new URL("https://gfycatporntube.com/blowjob-bunny-puts-on-a-show/")); GfycatporntubeRipper ripper = new GfycatporntubeRipper(new URL("https://gfycatporntube.com/blowjob-bunny-puts-on-a-show/"));
testRipper(ripper); testRipper(ripper);
} }
public void testGetGID() throws IOException {
URL url = new URL("https://gfycatporntube.com/blowjob-bunny-puts-on-a-show/");
GfycatporntubeRipper ripper = new GfycatporntubeRipper(url);
assertEquals("blowjob-bunny-puts-on-a-show", ripper.getGID(url));
}
} }

View File

@ -10,4 +10,10 @@ public class ImagevenueRipperTest extends RippersTest {
ImagevenueRipper ripper = new ImagevenueRipper(new URL("http://img120.imagevenue.com/galshow.php?gal=gallery_1373818527696_191lo")); ImagevenueRipper ripper = new ImagevenueRipper(new URL("http://img120.imagevenue.com/galshow.php?gal=gallery_1373818527696_191lo"));
testRipper(ripper); testRipper(ripper);
} }
public void testGetGID() throws IOException {
URL url = new URL("http://img120.imagevenue.com/galshow.php?gal=gallery_1373818527696_191lo");
ImagevenueRipper ripper = new ImagevenueRipper(url);
assertEquals("gallery_1373818527696_191lo", ripper.getGID(url));
}
} }

View File

@ -10,4 +10,10 @@ public class ImgboxRipperTest extends RippersTest {
ImgboxRipper ripper = new ImgboxRipper(new URL("https://imgbox.com/g/FJPF7t26FD")); ImgboxRipper ripper = new ImgboxRipper(new URL("https://imgbox.com/g/FJPF7t26FD"));
testRipper(ripper); testRipper(ripper);
} }
public void testGetGID() throws IOException {
URL url = new URL("https://imgbox.com/g/FJPF7t26FD");
ImgboxRipper ripper = new ImgboxRipper(url);
assertEquals("FJPF7t26FD", ripper.getGID(url));
}
} }

View File

@ -10,4 +10,10 @@ public class PornhubRipperTest extends RippersTest {
PornhubRipper ripper = new PornhubRipper(new URL("https://www.pornhub.com/album/15680522")); PornhubRipper ripper = new PornhubRipper(new URL("https://www.pornhub.com/album/15680522"));
testRipper(ripper); testRipper(ripper);
} }
public void testGetGID() throws IOException {
URL url = new URL("https://www.pornhub.com/album/15680522");
PornhubRipper ripper = new PornhubRipper(url);
assertEquals("15680522", ripper.getGID(url));
}
} }

View File

@ -11,4 +11,10 @@ public class Rule34RipperTest extends RippersTest {
testRipper(ripper); testRipper(ripper);
} }
public void testGetGID() throws IOException {
URL url = new URL("https://rule34.xxx/index.php?page=post&s=list&tags=bimbo");
Rule34Ripper ripper = new Rule34Ripper(url);
assertEquals("bimbo", ripper.getGID(url));
}
} }

View File

@ -10,4 +10,10 @@ public class TheyiffgalleryRipperTest extends RippersTest {
TheyiffgalleryRipper ripper = new TheyiffgalleryRipper(new URL("https://theyiffgallery.com/index?/category/4303")); TheyiffgalleryRipper ripper = new TheyiffgalleryRipper(new URL("https://theyiffgallery.com/index?/category/4303"));
testRipper(ripper); testRipper(ripper);
} }
public void testGetGID() throws IOException {
URL url = new URL("https://theyiffgallery.com/index?/category/4303");
TheyiffgalleryRipper ripper = new TheyiffgalleryRipper(url);
assertEquals("4303", ripper.getGID(url));
}
} }

View File

@ -15,4 +15,10 @@ public class WebtoonsRipperTest extends RippersTest {
WebtoonsRipper ripper = new WebtoonsRipper(new URL("http://www.webtoons.com/en/drama/lookism/ep-145/viewer?title_no=1049&episode_no=145")); WebtoonsRipper ripper = new WebtoonsRipper(new URL("http://www.webtoons.com/en/drama/lookism/ep-145/viewer?title_no=1049&episode_no=145"));
testRipper(ripper); testRipper(ripper);
} }
public void testGetGID() throws IOException {
URL url = new URL("http://www.webtoons.com/en/drama/my-boo/ep-33/viewer?title_no=1185&episode_no=33");
WebtoonsRipper ripper = new WebtoonsRipper(url);
assertEquals("my-boo", ripper.getGID(url));
}
} }