Skip to content

Commit

Permalink
Use real downloader for YoutubeSubscriptionExtractorTest
Browse files Browse the repository at this point in the history
It doesn't make network requests anyway
  • Loading branch information
XiangRongLin committed Jan 17, 2021
1 parent cab1b26 commit b0c4fee
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.junit.BeforeClass;
import org.junit.Test;
import org.schabi.newpipe.downloader.DownloaderFactory;
import org.schabi.newpipe.downloader.DownloaderTestImpl;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.ServiceList;
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
Expand All @@ -12,7 +12,6 @@

import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
Expand All @@ -28,15 +27,14 @@
*/
public class YoutubeSubscriptionExtractorTest {

private static final String RESOURCE_PATH = DownloaderFactory.RESOURCE_PATH + "services/youtube/extractor/subscription/";

private static YoutubeSubscriptionExtractor subscriptionExtractor;
private static LinkHandlerFactory urlHandler;

@BeforeClass
public static void setupClass() throws IOException {
YoutubeParsingHelper.resetClientVersionAndKey();
NewPipe.init(new DownloaderFactory().getDownloader(RESOURCE_PATH));
public static void setupClass() {
//Doesn't make network requests
NewPipe.init(DownloaderTestImpl.getInstance());
subscriptionExtractor = new YoutubeSubscriptionExtractor(ServiceList.YouTube);
urlHandler = ServiceList.YouTube.getChannelLHFactory();
}
Expand Down

0 comments on commit b0c4fee

Please sign in to comment.