refactored nhentai unit tests

This commit is contained in:
cyian-1756 2018-09-14 13:52:27 -04:00
parent e7df21b07f
commit ab17ed26ce

View File

@ -2,8 +2,10 @@ package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException;
import java.net.URL;
import java.util.List;
import com.rarchives.ripme.ripper.rippers.NhentaiRipper;
import com.rarchives.ripme.utils.RipUtils;
public class NhentaiRipperTest extends RippersTest {
public void testRip() throws IOException {
@ -20,14 +22,15 @@ public class NhentaiRipperTest extends RippersTest {
public void testTagBlackList() throws IOException {
URL url = new URL("https://nhentai.net/g/233295/");
NhentaiRipper ripper = new NhentaiRipper(url);
List<String> tagsOnPage = ripper.getTags(ripper.getFirstPage());
// Test multiple blacklisted tags
String[] tags = {"test", "one", "blowjob"};
String blacklistedTag = ripper.checkTags(ripper.getFirstPage(), tags);
String blacklistedTag = RipUtils.checkTags(tags, tagsOnPage);
assertEquals("blowjob", blacklistedTag);
// test tags with spaces in them
String[] tags2 = {"test", "one", "sole female"};
blacklistedTag = ripper.checkTags(ripper.getFirstPage(), tags2);
assertEquals("sole female", blacklistedTag);
String[] tags2 = {"test", "one", "sole-female"};
blacklistedTag = RipUtils.checkTags(tags2, tagsOnPage);
assertEquals("sole-female", blacklistedTag);
}
}