fixed Downloader.getInstance() in unit tests
This commit is contained in:
parent
3767a96e0f
commit
38c5cb50fb
7 changed files with 8 additions and 8 deletions
|
@ -32,7 +32,7 @@ public class YoutubeChannelExtractorTest extends AndroidTestCase {
|
||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
NewPipe.init(new Downloader());
|
NewPipe.init(Downloader.getInstance());
|
||||||
extractor = NewPipe.getService("Youtube")
|
extractor = NewPipe.getService("Youtube")
|
||||||
.getChannelExtractorInstance("https://www.youtube.com/channel/UCYJ61XIK64sp6ZFFS8sctxw", 0);
|
.getChannelExtractorInstance("https://www.youtube.com/channel/UCYJ61XIK64sp6ZFFS8sctxw", 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class YoutubeSearchEngineTest extends AndroidTestCase {
|
||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
NewPipe.init(new Downloader());
|
NewPipe.init(Downloader.getInstance());
|
||||||
SearchEngine engine = NewPipe.getService("Youtube").getSearchEngineInstance();
|
SearchEngine engine = NewPipe.getService("Youtube").getSearchEngineInstance();
|
||||||
|
|
||||||
result = engine.search("this is something boring", 0, "de").getSearchResult();
|
result = engine.search("this is something boring", 0, "de").getSearchResult();
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class YoutubeSearchResultTest extends AndroidTestCase {
|
||||||
@Override
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
NewPipe.init(new Downloader());
|
NewPipe.init(Downloader.getInstance());
|
||||||
SuggestionExtractor engine = new YoutubeSuggestionExtractor(0);
|
SuggestionExtractor engine = new YoutubeSuggestionExtractor(0);
|
||||||
suggestionReply = engine.suggestionList("hello", "de");
|
suggestionReply = engine.suggestionList("hello", "de");
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class YoutubeStreamExtractorDefaultTest extends AndroidTestCase {
|
||||||
|
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
NewPipe.init(new Downloader());
|
NewPipe.init(Downloader.getInstance());
|
||||||
extractor = NewPipe.getService("Youtube")
|
extractor = NewPipe.getService("Youtube")
|
||||||
.getExtractorInstance("https://www.youtube.com/watch?v=YQHsXMglC9A");
|
.getExtractorInstance("https://www.youtube.com/watch?v=YQHsXMglC9A");
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class YoutubeStreamExtractorGemaTest extends AndroidTestCase {
|
||||||
public void testGemaError() throws IOException, ExtractionException {
|
public void testGemaError() throws IOException, ExtractionException {
|
||||||
if(testActive) {
|
if(testActive) {
|
||||||
try {
|
try {
|
||||||
NewPipe.init(new Downloader());
|
NewPipe.init(Downloader.getInstance());
|
||||||
NewPipe.getService("Youtube")
|
NewPipe.getService("Youtube")
|
||||||
.getExtractorInstance("https://www.youtube.com/watch?v=3O1_3zBUKM8");
|
.getExtractorInstance("https://www.youtube.com/watch?v=3O1_3zBUKM8");
|
||||||
} catch(YoutubeStreamExtractor.GemaException ge) {
|
} catch(YoutubeStreamExtractor.GemaException ge) {
|
||||||
|
|
|
@ -38,9 +38,9 @@ public class YoutubeStreamExtractorLiveStreamTest extends AndroidTestCase {
|
||||||
//todo: make the extractor not throw over a livestream
|
//todo: make the extractor not throw over a livestream
|
||||||
/*
|
/*
|
||||||
|
|
||||||
NewPipe.init(new Downloader());
|
NewPipe.init(Downloader.getInstance());
|
||||||
extractor = NewPipe.getService("Youtube")
|
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 {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
NewPipe.init(new Downloader());
|
NewPipe.init(Downloader.getInstance());
|
||||||
extractor = NewPipe.getService("Youtube")
|
extractor = NewPipe.getService("Youtube")
|
||||||
.getExtractorInstance("https://www.youtube.com/watch?v=i6JTvzrpBy0");
|
.getExtractorInstance("https://www.youtube.com/watch?v=i6JTvzrpBy0");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue