Fix SoundCloud tests

This commit is contained in:
Stypox 2019-08-12 17:15:21 +02:00
parent b09e402d4f
commit d14c45c948
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
1 changed files with 10 additions and 9 deletions

View File

@ -1,5 +1,6 @@
package org.schabi.newpipe.extractor.services.soundcloud;
import org.hamcrest.CoreMatchers;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
@ -119,14 +120,14 @@ public class SoundcloudPlaylistExtractorTest {
}
}
public static class RandomHouseDanceMusic implements BasePlaylistExtractorTest {
public static class RandomHouseMusic implements BasePlaylistExtractorTest {
private static SoundcloudPlaylistExtractor extractor;
@BeforeClass
public static void setUp() throws Exception {
NewPipe.init(Downloader.getInstance(), new Localization("GB", "en"));
extractor = (SoundcloudPlaylistExtractor) SoundCloud
.getPlaylistExtractor("https://soundcloud.com/hunter-leader/sets/house-electro-dance-music-2");
.getPlaylistExtractor("https://soundcloud.com/micky96/sets/house");
extractor.fetchPage();
}
@ -141,22 +142,22 @@ public class SoundcloudPlaylistExtractorTest {
@Test
public void testName() {
assertEquals("House, Electro , Dance Music 2", extractor.getName());
assertEquals("House", extractor.getName());
}
@Test
public void testId() {
assertEquals("310980722", extractor.getId());
assertEquals("123062856", extractor.getId());
}
@Test
public void testUrl() throws Exception {
assertEquals("https://soundcloud.com/hunter-leader/sets/house-electro-dance-music-2", extractor.getUrl());
assertEquals("https://soundcloud.com/micky96/sets/house", extractor.getUrl());
}
@Test
public void testOriginalUrl() throws Exception {
assertEquals("https://soundcloud.com/hunter-leader/sets/house-electro-dance-music-2", extractor.getOriginalUrl());
assertEquals("https://soundcloud.com/micky96/sets/house", extractor.getOriginalUrl());
}
/*//////////////////////////////////////////////////////////////////////////
@ -182,7 +183,7 @@ public class SoundcloudPlaylistExtractorTest {
assertIsSecureUrl(extractor.getThumbnailUrl());
}
@Ignore
@Ignore("not implemented")
@Test
public void testBannerUrl() {
assertIsSecureUrl(extractor.getBannerUrl());
@ -192,12 +193,12 @@ public class SoundcloudPlaylistExtractorTest {
public void testUploaderUrl() {
final String uploaderUrl = extractor.getUploaderUrl();
assertIsSecureUrl(uploaderUrl);
assertTrue(uploaderUrl, uploaderUrl.contains("hunter-leader"));
assertThat(uploaderUrl, CoreMatchers.containsString("micky96"));
}
@Test
public void testUploaderName() {
assertEquals("Gosu", extractor.getUploaderName());
assertEquals("_mickyyy", extractor.getUploaderName());
}
@Test