Bandcamp: Fetch channelInfo in onFetchPage

This commit is contained in:
Fynn Godau
2020-04-20 22:06:48 +02:00
parent 433d72c26a
commit 00c0333059
4 changed files with 41 additions and 22 deletions

View File

@@ -6,6 +6,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.schabi.newpipe.DownloaderTestImpl;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.channel.ChannelExtractor;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampChannelExtractor;
@@ -18,12 +19,17 @@ import static org.schabi.newpipe.extractor.ServiceList.Bandcamp;
public class BandcampChannelExtractorTest {
private static BandcampChannelExtractor extractor;
private static ChannelExtractor noAvatarExtractor;
@BeforeClass
public static void setUp() throws Exception {
NewPipe.init(DownloaderTestImpl.getInstance());
extractor = (BandcampChannelExtractor) Bandcamp
.getChannelExtractor("https://zachbenson.bandcamp.com/");
extractor.fetchPage();
noAvatarExtractor = Bandcamp.getChannelExtractor("https://powertothequeerkids.bandcamp.com/");
noAvatarExtractor.fetchPage();
}
@Test
@@ -51,11 +57,11 @@ public class BandcampChannelExtractorTest {
@Test
public void testGetNoAvatar() throws ExtractionException {
assertEquals("", Bandcamp.getChannelExtractor("https://powertothequeerkids.bandcamp.com/").getAvatarUrl());
assertEquals("", noAvatarExtractor.getAvatarUrl());
}
@Test
public void testGetNoBanner() throws ExtractionException {
assertEquals("", Bandcamp.getChannelExtractor("https://powertothequeerkids.bandcamp.com/").getBannerUrl());
assertEquals("", noAvatarExtractor.getBannerUrl());
}
}