validate peertube instance

This commit is contained in:
yausername
2019-11-22 22:59:14 +05:30
parent 4e0adbefbc
commit 279f175693
8 changed files with 21 additions and 50 deletions

View File

@@ -31,7 +31,7 @@ public class PeertubeChannelExtractorTest {
public static void setUp() throws Exception {
NewPipe.init(DownloaderTestImpl.getInstance());
// setting instance might break test when running in parallel
PeerTube.setInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host");
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
extractor = (PeertubeChannelExtractor) PeerTube
.getChannelExtractor("https://peertube.mastodon.host/api/v1/accounts/kde");
extractor.fetchPage();
@@ -118,7 +118,7 @@ public class PeertubeChannelExtractorTest {
public static void setUp() throws Exception {
NewPipe.init(DownloaderTestImpl.getInstance());
// setting instance might break test when running in parallel
PeerTube.setInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host");
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
extractor = (PeertubeChannelExtractor) PeerTube
.getChannelExtractor("https://peertube.mastodon.host/accounts/booteille");
extractor.fetchPage();

View File

@@ -34,7 +34,7 @@ public class PeertubeStreamExtractorDefaultTest {
public static void setUp() throws Exception {
NewPipe.init(DownloaderTestImpl.getInstance());
// setting instance might break test when running in parallel
PeerTube.setInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host");
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
extractor = (PeertubeStreamExtractor) PeerTube.getStreamExtractor("https://peertube.mastodon.host/videos/watch/afe5bf12-c58b-4efd-b56e-29c5a59e04bc");
extractor.fetchPage();
}

View File

@@ -28,7 +28,7 @@ public class PeertubeTrendingExtractorTest {
public static void setUp() throws Exception {
NewPipe.init(DownloaderTestImpl.getInstance());
// setting instance might break test when running in parallel
PeerTube.setInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host");
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
extractor = PeerTube
.getKioskList()
.getExtractorById("Trending", null);

View File

@@ -21,7 +21,7 @@ public class PeertubeTrendingLinkHandlerFactoryTest {
@BeforeClass
public static void setUp() throws Exception {
// setting instance might break test when running in parallel
PeerTube.setInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host");
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
LinkHandlerFactory = new PeertubeTrendingLinkHandlerFactory();
NewPipe.init(DownloaderTestImpl.getInstance());
}

View File

@@ -11,6 +11,7 @@ import org.schabi.newpipe.DownloaderTestImpl;
import org.schabi.newpipe.extractor.InfoItem;
import org.schabi.newpipe.extractor.ListExtractor;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.services.peertube.PeertubeInstance;
import org.schabi.newpipe.extractor.services.peertube.extractors.PeertubeSearchExtractor;
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
@@ -23,7 +24,7 @@ public class PeertubeSearchExtractorDefaultTest extends PeertubeSearchExtractorB
public static void setUpClass() throws Exception {
NewPipe.init(DownloaderTestImpl.getInstance());
// setting instance might break test when running in parallel
PeerTube.setInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host");
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
extractor = (PeertubeSearchExtractor) PeerTube.getSearchExtractor("kde");
extractor.fetchPage();
itemsPage = extractor.getInitialPage();

View File

@@ -5,13 +5,14 @@ import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
import org.junit.BeforeClass;
import org.junit.Test;
import org.schabi.newpipe.extractor.services.peertube.PeertubeInstance;
public class PeertubeSearchQHTest {
@BeforeClass
public static void setUpClass() throws Exception {
// setting instance might break test when running in parallel
PeerTube.setInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host");
PeerTube.setInstance(new PeertubeInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"));
}
@Test