fixed tests

This commit is contained in:
Ritvik Saraf 2019-03-10 00:30:01 +05:30
parent 36139558c6
commit c220700c94
3 changed files with 6 additions and 1 deletions

View File

@ -44,7 +44,7 @@ public class MediaCCCSearchExtractorEventsTest {
@Test @Test
public void testServiceId() throws Exception { public void testServiceId() throws Exception {
assertEquals(2, extractor.getServiceId()); assertEquals(3, extractor.getServiceId());
} }
@Test @Test

View File

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

View File

@ -2,6 +2,7 @@ package org.schabi.newpipe.extractor.services.peertube;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
@ -20,6 +21,8 @@ public class PeertubeTrendingLinkHandlerFactoryTest {
@BeforeClass @BeforeClass
public static void setUp() throws Exception { 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");
LinkHandlerFactory = new PeertubeTrendingLinkHandlerFactory(); LinkHandlerFactory = new PeertubeTrendingLinkHandlerFactory();
NewPipe.init(Downloader.getInstance(), new Localization("GB", "en")); NewPipe.init(Downloader.getInstance(), new Localization("GB", "en"));
} }