[SoundCloud] Apply changes in extractor tests

This commit is contained in:
AudricV 2022-08-03 16:42:49 +02:00
parent 93a210394d
commit 1d72bac53d
No known key found for this signature in database
GPG Key ID: DA92EC7905614198
2 changed files with 45 additions and 36 deletions

View File

@ -9,11 +9,13 @@ import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.services.BaseChannelExtractorTest; import org.schabi.newpipe.extractor.services.BaseChannelExtractorTest;
import org.schabi.newpipe.extractor.services.soundcloud.extractors.SoundcloudChannelExtractor; import org.schabi.newpipe.extractor.services.soundcloud.extractors.SoundcloudChannelExtractor;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmpty; import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmpty;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertTabsContain; import static org.schabi.newpipe.extractor.ExtractorAsserts.assertTabsContain;
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud; import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestImageCollection;
/** /**
* Test for {@link SoundcloudChannelExtractor} * Test for {@link SoundcloudChannelExtractor}
@ -69,13 +71,13 @@ public class SoundcloudChannelExtractorTest {
} }
@Test @Test
public void testAvatarUrl() { public void testAvatars() {
assertIsSecureUrl(extractor.getAvatarUrl()); defaultTestImageCollection(extractor.getAvatars());
} }
@Test @Test
public void testBannerUrl() { public void testBanners() {
assertIsSecureUrl(extractor.getBannerUrl()); defaultTestImageCollection(extractor.getBanners());
} }
@Test @Test
@ -157,13 +159,13 @@ public class SoundcloudChannelExtractorTest {
} }
@Test @Test
public void testAvatarUrl() { public void testAvatars() {
assertIsSecureUrl(extractor.getAvatarUrl()); defaultTestImageCollection(extractor.getAvatars());
} }
@Test @Test
public void testBannerUrl() { public void testBanners() {
assertIsSecureUrl(extractor.getBannerUrl()); defaultTestImageCollection(extractor.getBanners());
} }
@Test @Test

View File

@ -13,11 +13,18 @@ import org.schabi.newpipe.extractor.services.BasePlaylistExtractorTest;
import org.schabi.newpipe.extractor.services.soundcloud.extractors.SoundcloudPlaylistExtractor; import org.schabi.newpipe.extractor.services.soundcloud.extractors.SoundcloudPlaylistExtractor;
import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmpty; import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmpty;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl; import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud; import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
import static org.schabi.newpipe.extractor.services.DefaultTests.*; import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestGetPageInNewExtractor;
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestImageCollection;
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestListOfItems;
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestMoreItems;
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestRelatedItems;
/** /**
* Test for {@link PlaylistExtractor} * Test for {@link PlaylistExtractor}
@ -82,14 +89,14 @@ public class SoundcloudPlaylistExtractorTest {
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
@Test @Test
public void testThumbnailUrl() { public void testThumbnails() {
assertIsSecureUrl(extractor.getThumbnailUrl()); defaultTestImageCollection(extractor.getThumbnails());
} }
@Test @Test
public void testBannerUrl() throws ParsingException { public void testBanners() throws ParsingException {
// SoundCloud playlists do not have a banner // SoundCloud playlists do not have a banner
assertEmpty(extractor.getBannerUrl()); assertEmpty(extractor.getBanners());
} }
@Test @Test
@ -105,8 +112,8 @@ public class SoundcloudPlaylistExtractorTest {
} }
@Test @Test
public void testUploaderAvatarUrl() { public void testUploaderAvatars() {
assertIsSecureUrl(extractor.getUploaderAvatarUrl()); defaultTestImageCollection(extractor.getUploaderAvatars());
} }
@Test @Test
@ -179,14 +186,14 @@ public class SoundcloudPlaylistExtractorTest {
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
@Test @Test
public void testThumbnailUrl() { public void testThumbnails() {
assertIsSecureUrl(extractor.getThumbnailUrl()); defaultTestImageCollection(extractor.getThumbnails());
} }
@Test @Test
public void testBannerUrl() throws ParsingException { public void testBanners() throws ParsingException {
// SoundCloud playlists do not have a banner // SoundCloud playlists do not have a banner
assertEmpty(extractor.getBannerUrl()); assertEmpty(extractor.getBanners());
} }
@Test @Test
@ -202,8 +209,8 @@ public class SoundcloudPlaylistExtractorTest {
} }
@Test @Test
public void testUploaderAvatarUrl() { public void testUploaderAvatars() {
assertIsSecureUrl(extractor.getUploaderAvatarUrl()); defaultTestImageCollection(extractor.getUploaderAvatars());
} }
@Test @Test
@ -291,14 +298,14 @@ public class SoundcloudPlaylistExtractorTest {
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
@Test @Test
public void testThumbnailUrl() { public void testThumbnails() {
assertIsSecureUrl(extractor.getThumbnailUrl()); defaultTestImageCollection(extractor.getThumbnails());
} }
@Test @Test
public void testBannerUrl() throws ParsingException { public void testBanners() throws ParsingException {
// SoundCloud playlists do not have a banner // SoundCloud playlists do not have a banner
assertEmpty(extractor.getBannerUrl()); assertEmpty(extractor.getBanners());
} }
@Test @Test
@ -314,8 +321,8 @@ public class SoundcloudPlaylistExtractorTest {
} }
@Test @Test
public void testUploaderAvatarUrl() { public void testUploaderAvatars() {
assertIsSecureUrl(extractor.getUploaderAvatarUrl()); defaultTestImageCollection(extractor.getUploaderAvatars());
} }
@Test @Test
@ -395,14 +402,14 @@ public class SoundcloudPlaylistExtractorTest {
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
@Test @Test
public void testThumbnailUrl() { public void testThumbnails() {
assertIsSecureUrl(extractor.getThumbnailUrl()); defaultTestImageCollection(extractor.getThumbnails());
} }
@Test @Test
public void testBannerUrl() throws ParsingException { public void testBanners() throws ParsingException {
// SoundCloud playlists do not have a banner // SoundCloud playlists do not have a banner
assertEmpty(extractor.getBannerUrl()); assertEmpty(extractor.getBanners());
} }
@Test @Test
@ -418,8 +425,8 @@ public class SoundcloudPlaylistExtractorTest {
} }
@Test @Test
public void testUploaderAvatarUrl() { public void testUploaderAvatars() {
assertIsSecureUrl(extractor.getUploaderAvatarUrl()); defaultTestImageCollection(extractor.getUploaderAvatars());
} }
@Test @Test