From d14c45c948d3f0641cd41961dca93c7c860d3018 Mon Sep 17 00:00:00 2001 From: Stypox Date: Mon, 12 Aug 2019 17:15:21 +0200 Subject: [PATCH] Fix SoundCloud tests --- .../SoundcloudPlaylistExtractorTest.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistExtractorTest.java index 06d03b1f5..ec020109e 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistExtractorTest.java @@ -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