Bandcamp channel extractor: handel nonexistent images better

This commit is contained in:
Fynn Godau
2019-12-22 01:38:48 +01:00
parent 91c0ec7cea
commit 794ca5eeae
3 changed files with 22 additions and 2 deletions

View File

@@ -4,6 +4,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.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampChannelExtractor;
import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampExtractorHelper;
@@ -45,4 +46,14 @@ public class BandcampChannelExtractorTest {
// Why is this picture in png format when all other pictures are jpg?
assertTrue(extractor.getBannerUrl().endsWith(".png"));
}
@Test
public void testGetNoAvatar() throws ExtractionException {
assertEquals("", bandcamp.getChannelExtractor("https://powertothequeerkids.bandcamp.com/").getAvatarUrl());
}
@Test
public void testGetNoBanner() throws ExtractionException {
assertEquals("", bandcamp.getChannelExtractor("https://powertothequeerkids.bandcamp.com/").getBannerUrl());
}
}