2019-12-22 17:30:22 +01:00
|
|
|
// Created by Fynn Godau 2019, licensed GNU GPL version 3 or later
|
|
|
|
|
|
|
|
package org.schabi.newpipe.extractor.services.bandcamp;
|
|
|
|
|
|
|
|
import org.junit.BeforeClass;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.schabi.newpipe.DownloaderTestImpl;
|
|
|
|
import org.schabi.newpipe.extractor.InfoItem;
|
|
|
|
import org.schabi.newpipe.extractor.NewPipe;
|
|
|
|
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
|
|
|
import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampRadioExtractor;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertTrue;
|
2020-04-20 21:55:35 +02:00
|
|
|
import static org.schabi.newpipe.extractor.ServiceList.Bandcamp;
|
2019-12-22 17:30:22 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tests for {@link BandcampRadioExtractor}
|
|
|
|
*/
|
|
|
|
public class BandcampRadioExtractorTest {
|
|
|
|
|
|
|
|
private static BandcampRadioExtractor extractor;
|
|
|
|
|
|
|
|
@BeforeClass
|
|
|
|
public static void setUp() throws ExtractionException, IOException {
|
|
|
|
NewPipe.init(DownloaderTestImpl.getInstance());
|
2020-04-20 21:55:35 +02:00
|
|
|
extractor = (BandcampRadioExtractor) Bandcamp
|
2019-12-22 17:30:22 +01:00
|
|
|
.getKioskList()
|
|
|
|
.getExtractorById("Radio", null);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testRadioCount() throws ExtractionException, IOException {
|
2020-04-20 21:55:35 +02:00
|
|
|
List<InfoItem> list = Bandcamp.getKioskList().getExtractorById("Radio", null).getInitialPage().getItems();
|
2019-12-22 17:30:22 +01:00
|
|
|
assertTrue(list.size() > 300);
|
|
|
|
}
|
|
|
|
}
|