1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-23 22:14:06 +02:00

new URI instead of new URL in tests.

This commit is contained in:
soloturn
2023-06-13 06:19:54 +02:00
parent a996825735
commit 45e0e2fa61
4 changed files with 28 additions and 22 deletions

View File

@@ -1,6 +1,8 @@
package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
@@ -15,31 +17,31 @@ import org.junit.jupiter.api.Test;
public class DeviantartRipperTest extends RippersTest {
@Test
@Disabled("Broken ripper")
public void testDeviantartAlbum() throws IOException {
DeviantartRipper ripper = new DeviantartRipper(new URL("https://www.deviantart.com/airgee/gallery/"));
public void testDeviantartAlbum() throws IOException, URISyntaxException {
DeviantartRipper ripper = new DeviantartRipper(new URI("https://www.deviantart.com/airgee/gallery/").toURL());
testRipper(ripper);
}
@Test
@Disabled("Broken ripper")
public void testDeviantartNSFWAlbum() throws IOException {
public void testDeviantartNSFWAlbum() throws IOException, URISyntaxException {
// NSFW gallery
DeviantartRipper ripper = new DeviantartRipper(new URL("https://www.deviantart.com/faterkcx/gallery/"));
DeviantartRipper ripper = new DeviantartRipper(new URI("https://www.deviantart.com/faterkcx/gallery/").toURL());
testRipper(ripper);
}
@Test
@Disabled("Broken ripper")
public void testGetGID() throws IOException {
URL url = new URL("https://www.deviantart.com/airgee/gallery/");
public void testGetGID() throws IOException, URISyntaxException {
URL url = new URI("https://www.deviantart.com/airgee/gallery/").toURL();
DeviantartRipper ripper = new DeviantartRipper(url);
Assertions.assertEquals("airgee", ripper.getGID(url));
}
@Test
@Disabled("Broken ripper")
public void testGetGalleryIDAndUsername() throws IOException {
URL url = new URL("https://www.deviantart.com/airgee/gallery/");
public void testGetGalleryIDAndUsername() throws IOException, URISyntaxException {
URL url = new URI("https://www.deviantart.com/airgee/gallery/").toURL();
DeviantartRipper ripper = new DeviantartRipper(url);
Document doc = Http.url(url).get();
// Had to comment because of refactoring/style change
@@ -49,11 +51,11 @@ public class DeviantartRipperTest extends RippersTest {
@Test
@Disabled("Broken ripper")
public void testSanitizeURL() throws IOException {
public void testSanitizeURL() throws IOException, URISyntaxException {
List<URL> urls = new ArrayList<URL>();
urls.add(new URL("https://www.deviantart.com/airgee/"));
urls.add(new URL("https://www.deviantart.com/airgee"));
urls.add(new URL("https://www.deviantart.com/airgee/gallery/"));
urls.add(new URI("https://www.deviantart.com/airgee/").toURL());
urls.add(new URI("https://www.deviantart.com/airgee").toURL());
urls.add(new URI("https://www.deviantart.com/airgee/gallery/").toURL());
for (URL url : urls) {
DeviantartRipper ripper = new DeviantartRipper(url);

View File

@@ -1,7 +1,8 @@
package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
import com.rarchives.ripme.ripper.rippers.DribbbleRipper;
import org.junit.jupiter.api.Disabled;
@@ -10,8 +11,8 @@ import org.junit.jupiter.api.Test;
public class DribbbleRipperTest extends RippersTest {
@Test
@Disabled("test or ripper broken")
public void testDribbbleRip() throws IOException {
DribbbleRipper ripper = new DribbbleRipper(new URL("https://dribbble.com/typogriff"));
public void testDribbbleRip() throws IOException, URISyntaxException {
DribbbleRipper ripper = new DribbbleRipper(new URI("https://dribbble.com/typogriff").toURL());
testRipper(ripper);
}
}

View File

@@ -6,14 +6,15 @@ import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.net.URL;
import java.net.URI;
import java.net.URISyntaxException;
public class DuckmoviesRipperTest extends RippersTest {
@Test
@Disabled("Broken ripper")
public void testRip() throws IOException {
public void testRip() throws IOException, URISyntaxException {
DuckmoviesRipper ripper = new DuckmoviesRipper(
new URL("https://palapaja.com/spyfam-stepbro-gives-in-to-stepsis-asian-persuasion/"));
new URI("https://palapaja.com/spyfam-stepbro-gives-in-to-stepsis-asian-persuasion/").toURL());
testRipper(ripper);
}

View File

@@ -1,6 +1,8 @@
package com.rarchives.ripme.tst.ripper.rippers;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.List;
@@ -11,15 +13,15 @@ import org.junit.jupiter.api.Test;
public class EhentaiRipperTest extends RippersTest {
@Test
public void testEHentaiAlbum() throws IOException {
EHentaiRipper ripper = new EHentaiRipper(new URL("https://e-hentai.org/g/1144492/e823bdf9a5/"));
public void testEHentaiAlbum() throws IOException, URISyntaxException {
EHentaiRipper ripper = new EHentaiRipper(new URI("https://e-hentai.org/g/1144492/e823bdf9a5/").toURL());
testRipper(ripper);
}
// Test the tag black listing
@Test
public void testTagBlackList() throws IOException {
URL url = new URL("https://e-hentai.org/g/1228503/1a2f455f96/");
public void testTagBlackList() throws IOException, URISyntaxException {
URL url = new URI("https://e-hentai.org/g/1228503/1a2f455f96/").toURL();
EHentaiRipper ripper = new EHentaiRipper(url);
List<String> tagsOnPage = ripper.getTags(ripper.getFirstPage());
// Test multiple blacklisted tags