merge with changes from master
This commit is contained in:
@@ -4,12 +4,10 @@ import org.junit.Test;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.NewPipe.getServiceByUrl;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||
import static org.schabi.newpipe.extractor.NewPipe.getServiceByUrl;
|
||||
|
||||
public class NewPipeTest {
|
||||
@Test
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.schabi.newpipe.extractor.services.soundcloud;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.Downloader;
|
||||
import org.schabi.newpipe.extractor.ListExtractor;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
|
||||
|
||||
@@ -31,17 +32,17 @@ public class SoundcloudChannelExtractorTest {
|
||||
|
||||
@Test
|
||||
public void testGetName() throws Exception {
|
||||
assertEquals(extractor.getName(), "LIL UZI VERT");
|
||||
assertEquals("LIL UZI VERT", extractor.getName());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetDescription() throws Exception {
|
||||
assertEquals(extractor.getDescription(), "");
|
||||
assertTrue(extractor.getDescription() != null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAvatarUrl() throws Exception {
|
||||
assertEquals(extractor.getAvatarUrl(), "https://a1.sndcdn.com/images/default_avatar_large.png");
|
||||
assertTrue(extractor.getAvatarUrl().contains("https://"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -70,7 +71,9 @@ public class SoundcloudChannelExtractorTest {
|
||||
public void testGetNextStreams() throws Exception {
|
||||
// Setup the streams
|
||||
extractor.getStreams();
|
||||
assertTrue("extractor didn't have next streams", !extractor.getNextStreams().nextItemsList.isEmpty());
|
||||
ListExtractor.NextItemsResult nextItemsResult = extractor.getNextStreams();
|
||||
assertTrue("extractor didn't have next streams", !nextItemsResult.nextItemsList.isEmpty());
|
||||
assertTrue("errors occurred during extraction of the next streams", nextItemsResult.errors.isEmpty());
|
||||
assertTrue("extractor didn't have more streams after getNextStreams", extractor.hasMoreStreams());
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.schabi.newpipe.extractor.services.soundcloud;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.Downloader;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
|
||||
public class SoundcloudParsingHelperTest {
|
||||
@BeforeClass
|
||||
public static void setUp() {
|
||||
NewPipe.init(Downloader.getInstance());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resolveUrlWithEmbedPlayerTest() throws Exception {
|
||||
Assert.assertEquals("https://soundcloud.com/trapcity", SoundcloudParsingHelper.resolveUrlWithEmbedPlayer("https://api.soundcloud.com/users/26057743"));
|
||||
Assert.assertEquals("https://soundcloud.com/nocopyrightsounds", SoundcloudParsingHelper.resolveUrlWithEmbedPlayer("https://api.soundcloud.com/users/16069159"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resolveIdWithEmbedPlayerTest() throws Exception {
|
||||
Assert.assertEquals("26057743", SoundcloudParsingHelper.resolveIdWithEmbedPlayer("https://soundcloud.com/trapcity"));
|
||||
Assert.assertEquals("16069159", SoundcloudParsingHelper.resolveIdWithEmbedPlayer("https://soundcloud.com/nocopyrightsounds"));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.Downloader;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
||||
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
@@ -40,7 +41,7 @@ public class SoundcloudPlaylistExtractorTest {
|
||||
|
||||
@Test
|
||||
public void testGetThumbnailUrl() throws Exception {
|
||||
assertEquals(extractor.getThumbnailUrl(), "https://i1.sndcdn.com/artworks-000174203688-bweu12-large.jpg");
|
||||
assertTrue(extractor.getThumbnailUrl(), extractor.getThumbnailUrl().contains("https://"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -55,7 +56,7 @@ public class SoundcloudPlaylistExtractorTest {
|
||||
|
||||
@Test
|
||||
public void testGetUploaderAvatarUrl() throws Exception {
|
||||
assertEquals(extractor.getUploaderAvatarUrl(), "https://a1.sndcdn.com/images/default_avatar_large.png");
|
||||
assertTrue(extractor.getUploaderAvatarUrl(), extractor.getUploaderAvatarUrl().contains("https://"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -79,4 +80,15 @@ public class SoundcloudPlaylistExtractorTest {
|
||||
extractor.getStreams();
|
||||
assertTrue("extractor didn't have more streams", !extractor.hasMoreStreams());
|
||||
}
|
||||
|
||||
@Test(expected = ExtractionException.class)
|
||||
public void testGetNextStreamsNonExistent() throws Exception {
|
||||
// Setup the streams
|
||||
extractor.getStreams();
|
||||
|
||||
// This playlist don't have more streams, it should throw an error
|
||||
extractor.getNextStreams();
|
||||
|
||||
fail("Expected exception wasn't thrown");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.search.SearchEngine;
|
||||
import org.schabi.newpipe.extractor.search.SearchResult;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
|
||||
@@ -27,9 +25,8 @@ public class SoundcloudSearchEngineAllTest {
|
||||
|
||||
// SoundCloud will suggest "lil uzi vert" instead of "lill uzi vert"
|
||||
// keep in mind that the suggestions can NOT change by country (the parameter "de")
|
||||
result = engine.search("lill uzi vert", 0, "de",
|
||||
EnumSet.of(SearchEngine.Filter.CHANNEL,
|
||||
SearchEngine.Filter.STREAM)).getSearchResult();
|
||||
result = engine.search("lill uzi vert", 0, "de", SearchEngine.Filter.ANY)
|
||||
.getSearchResult();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -9,8 +9,6 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.search.SearchEngine;
|
||||
import org.schabi.newpipe.extractor.search.SearchResult;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
|
||||
|
||||
@@ -27,8 +25,8 @@ public class SoundcloudSearchEngineChannelTest {
|
||||
|
||||
// SoundCloud will suggest "lil uzi vert" instead of "lill uzi vert"
|
||||
// keep in mind that the suggestions can NOT change by country (the parameter "de")
|
||||
result = engine.search("lill uzi vert", 0, "de",
|
||||
EnumSet.of(SearchEngine.Filter.CHANNEL)).getSearchResult();
|
||||
result = engine.search("lill uzi vert", 0, "de", SearchEngine.Filter.CHANNEL)
|
||||
.getSearchResult();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package org.schabi.newpipe.extractor.services.soundcloud;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.Downloader;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.search.SearchEngine;
|
||||
import org.schabi.newpipe.extractor.search.SearchResult;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
|
||||
|
||||
|
||||
/*
|
||||
* Created by Christian Schabesberger on 29.12.15.
|
||||
*
|
||||
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
|
||||
* YoutubeSearchEngineStreamTest.java is part of NewPipe.
|
||||
*
|
||||
* NewPipe is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* NewPipe is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Test for {@link SearchEngine}
|
||||
*/
|
||||
public class SoundcloudSearchEnginePlaylistTest {
|
||||
private SearchResult result;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
NewPipe.init(Downloader.getInstance());
|
||||
SearchEngine engine = SoundCloud.getService().getSearchEngine();
|
||||
|
||||
// Search by country not yet implemented
|
||||
result = engine.search("parkmemme", 0, "", SearchEngine.Filter.PLAYLIST)
|
||||
.getSearchResult();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResultList() {
|
||||
assertFalse(result.resultList.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUserItemType() {
|
||||
for (InfoItem infoItem : result.resultList) {
|
||||
assertEquals(InfoItem.InfoType.PLAYLIST, infoItem.info_type);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResultErrors() {
|
||||
if (!result.errors.isEmpty()) for (Throwable error : result.errors) error.printStackTrace();
|
||||
assertTrue(result.errors == null || result.errors.isEmpty());
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void testSuggestion() {
|
||||
//todo write a real test
|
||||
assertTrue(result.suggestion != null);
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,6 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.search.SearchEngine;
|
||||
import org.schabi.newpipe.extractor.search.SearchResult;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
|
||||
|
||||
@@ -27,8 +25,8 @@ public class SoundcloudSearchEngineStreamTest {
|
||||
|
||||
// SoundCloud will suggest "lil uzi vert" instead of "lil uzi vert",
|
||||
// keep in mind that the suggestions can NOT change by country (the parameter "de")
|
||||
result = engine.search("lill uzi vert", 0, "de",
|
||||
EnumSet.of(SearchEngine.Filter.STREAM)).getSearchResult();
|
||||
result = engine.search("lill uzi vert", 0, "de", SearchEngine.Filter.STREAM)
|
||||
.getSearchResult();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -77,12 +77,12 @@ public class SoundcloudStreamExtractorDefaultTest {
|
||||
|
||||
@Test
|
||||
public void testGetThumbnailUrl() throws ParsingException {
|
||||
assertEquals(extractor.getThumbnailUrl(), "https://i1.sndcdn.com/artworks-000174195399-iw6seg-large.jpg");
|
||||
assertTrue(extractor.getThumbnailUrl(), extractor.getThumbnailUrl().contains("https://"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetUploaderAvatarUrl() throws ParsingException {
|
||||
assertEquals(extractor.getUploaderAvatarUrl(), "https://a1.sndcdn.com/images/default_avatar_large.png");
|
||||
assertTrue(extractor.getUploaderAvatarUrl(), extractor.getUploaderAvatarUrl().contains("https://"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.schabi.newpipe.extractor.services.youtube;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.Downloader;
|
||||
import org.schabi.newpipe.extractor.ListExtractor;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
|
||||
|
||||
@@ -40,7 +41,7 @@ public class YoutubeChannelExtractorTest {
|
||||
public void setUp() throws Exception {
|
||||
NewPipe.init(Downloader.getInstance());
|
||||
extractor = YouTube.getService()
|
||||
.getChannelExtractor("https://www.youtube.com/channel/UCYJ61XIK64sp6ZFFS8sctxw");
|
||||
.getChannelExtractor("https://www.youtube.com/user/Gronkh");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -53,6 +54,16 @@ public class YoutubeChannelExtractorTest {
|
||||
assertEquals(extractor.getName(), "Gronkh");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetId() throws Exception {
|
||||
assertEquals(extractor.getId(), "UCYJ61XIK64sp6ZFFS8sctxw");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetUrl() throws Exception {
|
||||
assertEquals(extractor.getCleanUrl(), "https://www.youtube.com/channel/UCYJ61XIK64sp6ZFFS8sctxw");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetDescription() throws Exception {
|
||||
assertEquals(extractor.getDescription(), "★ ★ ★ KLICK MICH HART, DU SAU! :D ★ ★ ★ Zart im Schmelz und süffig im Abgang. Ungebremster Spieltrieb seit 1896. Tägliche Folgen nonstop seit dem 01.04.2010!...");
|
||||
@@ -70,7 +81,7 @@ public class YoutubeChannelExtractorTest {
|
||||
|
||||
@Test
|
||||
public void testGetFeedUrl() throws Exception {
|
||||
assertTrue(extractor.getFeedUrl(), extractor.getFeedUrl().contains("feed"));
|
||||
assertEquals(extractor.getFeedUrl(), "https://www.youtube.com/feeds/videos.xml?channel_id=UCYJ61XIK64sp6ZFFS8sctxw");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -99,7 +110,9 @@ public class YoutubeChannelExtractorTest {
|
||||
public void testGetNextStreams() throws Exception {
|
||||
// Setup the streams
|
||||
extractor.getStreams();
|
||||
assertTrue("extractor didn't have next streams", !extractor.getNextStreams().nextItemsList.isEmpty());
|
||||
ListExtractor.NextItemsResult nextItemsResult = extractor.getNextStreams();
|
||||
assertTrue("extractor didn't have next streams", !nextItemsResult.nextItemsList.isEmpty());
|
||||
assertTrue("errors occurred during extraction of the next streams", nextItemsResult.errors.isEmpty());
|
||||
assertTrue("extractor didn't have more streams after getNextStreams", extractor.hasMoreStreams());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.schabi.newpipe.extractor.services.youtube;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.Downloader;
|
||||
import org.schabi.newpipe.extractor.ListExtractor;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
|
||||
|
||||
@@ -89,7 +90,9 @@ public class YoutubePlaylistExtractorTest {
|
||||
public void testGetNextStreams() throws Exception {
|
||||
// Setup the streams
|
||||
extractor.getStreams();
|
||||
assertTrue("extractor didn't have next streams", !extractor.getNextStreams().nextItemsList.isEmpty());
|
||||
ListExtractor.NextItemsResult nextItemsResult = extractor.getNextStreams();
|
||||
assertTrue("extractor didn't have next streams", !nextItemsResult.nextItemsList.isEmpty());
|
||||
assertTrue("errors occurred during extraction of the next streams", nextItemsResult.errors.isEmpty());
|
||||
assertTrue("extractor didn't have more streams after getNextStreams", extractor.hasMoreStreams());
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.search.SearchEngine;
|
||||
import org.schabi.newpipe.extractor.search.SearchResult;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||
@@ -48,9 +46,8 @@ public class YoutubeSearchEngineAllTest {
|
||||
|
||||
// Youtube will suggest "asdf" instead of "asdgff"
|
||||
// keep in mind that the suggestions can change by country (the parameter "de")
|
||||
result = engine.search("asdgff", 0, "de",
|
||||
EnumSet.of(SearchEngine.Filter.CHANNEL,
|
||||
SearchEngine.Filter.STREAM)).getSearchResult();
|
||||
result = engine.search("asdgff", 0, "de", SearchEngine.Filter.ANY)
|
||||
.getSearchResult();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -9,8 +9,6 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.search.SearchEngine;
|
||||
import org.schabi.newpipe.extractor.search.SearchResult;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||
|
||||
@@ -48,8 +46,8 @@ public class YoutubeSearchEngineChannelTest {
|
||||
|
||||
// Youtube will suggest "gronkh" instead of "grrunkh"
|
||||
// keep in mind that the suggestions can change by country (the parameter "de")
|
||||
result = engine.search("grrunkh", 0, "de",
|
||||
EnumSet.of(SearchEngine.Filter.CHANNEL)).getSearchResult();
|
||||
result = engine.search("grrunkh", 0, "de", SearchEngine.Filter.CHANNEL)
|
||||
.getSearchResult();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package org.schabi.newpipe.extractor.services.youtube;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.schabi.newpipe.Downloader;
|
||||
import org.schabi.newpipe.extractor.InfoItem;
|
||||
import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.search.SearchEngine;
|
||||
import org.schabi.newpipe.extractor.search.SearchResult;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||
|
||||
|
||||
/*
|
||||
* Created by Christian Schabesberger on 29.12.15.
|
||||
*
|
||||
* Copyright (C) Christian Schabesberger 2015 <chris.schabesberger@mailbox.org>
|
||||
* YoutubeSearchEngineStreamTest.java is part of NewPipe.
|
||||
*
|
||||
* NewPipe is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* NewPipe is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Test for {@link SearchEngine}
|
||||
*/
|
||||
public class YoutubeSearchEnginePlaylistTest {
|
||||
private SearchResult result;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
NewPipe.init(Downloader.getInstance());
|
||||
SearchEngine engine = YouTube.getService().getSearchEngine();
|
||||
|
||||
// Youtube will suggest "gronkh" instead of "grrunkh"
|
||||
// keep in mind that the suggestions can change by country (the parameter "de")
|
||||
result = engine.search("grrunkh", 0, "de", SearchEngine.Filter.PLAYLIST)
|
||||
.getSearchResult();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResultList() {
|
||||
assertFalse(result.resultList.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUserItemType() {
|
||||
for (InfoItem infoItem : result.resultList) {
|
||||
assertEquals(InfoItem.InfoType.PLAYLIST, infoItem.info_type);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResultErrors() {
|
||||
if (!result.errors.isEmpty()) for (Throwable error : result.errors) error.printStackTrace();
|
||||
assertTrue(result.errors == null || result.errors.isEmpty());
|
||||
}
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void testSuggestion() {
|
||||
//todo write a real test
|
||||
assertTrue(result.suggestion != null);
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,6 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||
import org.schabi.newpipe.extractor.search.SearchEngine;
|
||||
import org.schabi.newpipe.extractor.search.SearchResult;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||
|
||||
@@ -48,8 +46,8 @@ public class YoutubeSearchEngineStreamTest {
|
||||
|
||||
// Youtube will suggest "results" instead of "rsults",
|
||||
// keep in mind that the suggestions can change by country (the parameter "de")
|
||||
result = engine.search("rsults", 0, "de",
|
||||
EnumSet.of(SearchEngine.Filter.STREAM)).getSearchResult();
|
||||
result = engine.search("rsults", 0, "de", SearchEngine.Filter.STREAM)
|
||||
.getSearchResult();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -13,9 +13,7 @@ import org.schabi.newpipe.extractor.stream.VideoStream;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||
|
||||
/*
|
||||
|
||||
@@ -67,7 +67,7 @@ public class YoutubeStreamExtractorRestrictedTest {
|
||||
|
||||
@Test
|
||||
public void testGetViews() throws ParsingException {
|
||||
assertTrue(extractor.getLength() > 0);
|
||||
assertTrue(extractor.getViewCount() > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user