From 99a5d88854b844c576d2c8196968cc07fa663ecb Mon Sep 17 00:00:00 2001 From: Tush-r Date: Thu, 29 Aug 2024 17:21:01 +0530 Subject: [PATCH] Fix rgif ripper tests --- .../tst/ripper/rippers/RedgifsRipperTest.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/RedgifsRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/RedgifsRipperTest.java index f89f9c40..3ef0759c 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/RedgifsRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/RedgifsRipperTest.java @@ -2,7 +2,6 @@ package com.rarchives.ripme.tst.ripper.rippers; import com.rarchives.ripme.ripper.rippers.RedditRipper; import com.rarchives.ripme.ripper.rippers.RedgifsRipper; -import org.jsoup.nodes.Document; import org.junit.jupiter.api.*; import java.io.IOException; @@ -15,9 +14,8 @@ public class RedgifsRipperTest extends RippersTest { * Rips correctly formatted URL directly from Redgifs */ @Test - @Disabled("test or ripper broken") public void testRedgifsGoodURL() throws IOException, URISyntaxException { - RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/watch/talkativewarpeddragon-petite").toURL()); + RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/watch/ashamedselfishcoypu").toURL()); testRipper(ripper); } @@ -25,36 +23,38 @@ public class RedgifsRipperTest extends RippersTest { * Rips gifdeliverynetwork URL's by redirecting them to proper redgifs url */ @Test - @Tag("flaky") public void testRedgifsBadRL() throws IOException, URISyntaxException { - RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.gifdeliverynetwork.com/foolishelasticchimpanzee").toURL()); + RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.gifdeliverynetwork.com/consideratetrustworthypigeon").toURL()); testRipper(ripper); } /** - * Rips a Redifs profile + * Rips a Redgifs profile */ @Test - @Tag("flaky") public void testRedgifsProfile() throws IOException, URISyntaxException { - RedgifsRipper ripper = new RedgifsRipper(new URI("https://redgifs.com/users/margo_monty").toURL()); + RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/users/ra-kunv2").toURL()); testRipper(ripper); } /** - * Rips a Redifs category/search + * Rips a Redgif search * @throws IOException */ @Test - @Disabled("test or ripper broken") public void testRedgifsSearch() throws IOException, URISyntaxException { - RedgifsRipper ripper = new RedgifsRipper(new URI("https://redgifs.com/gifs/browse/little-caprice").toURL()); - Document doc = ripper.getFirstPage(); + RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/search?query=take+a+shot+every+time").toURL()); + testRipper(ripper); + } - doc = ripper.getNextPage(doc); - Assertions.assertTrue("https://api.redgifs.com/v1/gfycats/search?search_text=little%20caprice&count=150&start=150".equalsIgnoreCase(doc.location())); - doc = ripper.getNextPage(doc); - Assertions.assertTrue("https://api.redgifs.com/v1/gfycats/search?search_text=little%20caprice&count=150&start=300".equalsIgnoreCase(doc.location())); + /** + * Rips Redgif tags + * @throws IOException + */ + @Test + public void testRedgifsTags() throws IOException, URISyntaxException { + RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/gifs/animation,sfw,funny?order=best&tab=gifs").toURL()); + testRipper(ripper); } @Test