mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-21 08:09:38 +01:00
fixed Downloader.getInstance() in unit tests
This commit is contained in:
parent
3767a96e0f
commit
38c5cb50fb
@ -32,7 +32,7 @@ public class YoutubeChannelExtractorTest extends AndroidTestCase {
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
NewPipe.init(new Downloader());
|
||||
NewPipe.init(Downloader.getInstance());
|
||||
extractor = NewPipe.getService("Youtube")
|
||||
.getChannelExtractorInstance("https://www.youtube.com/channel/UCYJ61XIK64sp6ZFFS8sctxw", 0);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public class YoutubeSearchEngineTest extends AndroidTestCase {
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
NewPipe.init(new Downloader());
|
||||
NewPipe.init(Downloader.getInstance());
|
||||
SearchEngine engine = NewPipe.getService("Youtube").getSearchEngineInstance();
|
||||
|
||||
result = engine.search("this is something boring", 0, "de").getSearchResult();
|
||||
|
@ -38,7 +38,7 @@ public class YoutubeSearchResultTest extends AndroidTestCase {
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
NewPipe.init(new Downloader());
|
||||
NewPipe.init(Downloader.getInstance());
|
||||
SuggestionExtractor engine = new YoutubeSuggestionExtractor(0);
|
||||
suggestionReply = engine.suggestionList("hello", "de");
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class YoutubeStreamExtractorDefaultTest extends AndroidTestCase {
|
||||
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
NewPipe.init(new Downloader());
|
||||
NewPipe.init(Downloader.getInstance());
|
||||
extractor = NewPipe.getService("Youtube")
|
||||
.getExtractorInstance("https://www.youtube.com/watch?v=YQHsXMglC9A");
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public class YoutubeStreamExtractorGemaTest extends AndroidTestCase {
|
||||
public void testGemaError() throws IOException, ExtractionException {
|
||||
if(testActive) {
|
||||
try {
|
||||
NewPipe.init(new Downloader());
|
||||
NewPipe.init(Downloader.getInstance());
|
||||
NewPipe.getService("Youtube")
|
||||
.getExtractorInstance("https://www.youtube.com/watch?v=3O1_3zBUKM8");
|
||||
} catch(YoutubeStreamExtractor.GemaException ge) {
|
||||
|
@ -38,9 +38,9 @@ public class YoutubeStreamExtractorLiveStreamTest extends AndroidTestCase {
|
||||
//todo: make the extractor not throw over a livestream
|
||||
/*
|
||||
|
||||
NewPipe.init(new Downloader());
|
||||
NewPipe.init(Downloader.getInstance());
|
||||
extractor = NewPipe.getService("Youtube")
|
||||
.getExtractorInstance("https://www.youtube.com/watch?v=J0s6NjqdjLE", new Downloader());
|
||||
.getExtractorInstance("https://www.youtube.com/watch?v=J0s6NjqdjLE", Downloader.getInstance());
|
||||
*/
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ public class YoutubeStreamExtractorRestrictedTest extends AndroidTestCase {
|
||||
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
NewPipe.init(new Downloader());
|
||||
NewPipe.init(Downloader.getInstance());
|
||||
extractor = NewPipe.getService("Youtube")
|
||||
.getExtractorInstance("https://www.youtube.com/watch?v=i6JTvzrpBy0");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user