Fix some test source code
This commit is contained in:
parent
d59618d0e7
commit
239df49df3
2 changed files with 3 additions and 12 deletions
|
@ -1,6 +1,5 @@
|
||||||
package org.schabi.newpipe.extractor.services.youtube;
|
package org.schabi.newpipe.extractor.services.youtube;
|
||||||
|
|
||||||
import com.grack.nanojson.JsonParserException;
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
|
@ -31,6 +31,7 @@ import static junit.framework.TestCase.assertFalse;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmptyErrors;
|
||||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,21 +69,12 @@ public class YoutubeTrendingExtractorTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGetStreams() throws Exception {
|
public void testGetStreams() throws Exception {
|
||||||
StreamInfoItemCollector collector = extractor.getStreams();
|
StreamInfoItemCollector collector = extractor.getStreams();
|
||||||
if(!collector.getErrors().isEmpty()) {
|
assertTrue("no streams are received", collector.getItemList().isEmpty());
|
||||||
System.err.println("----------");
|
|
||||||
for(Throwable e : collector.getErrors()) {
|
|
||||||
e.printStackTrace();
|
|
||||||
System.err.println("----------");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
assertTrue("no streams are received",
|
|
||||||
!collector.getItemList().isEmpty()
|
|
||||||
&& collector.getErrors().isEmpty());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetStreamsErrors() throws Exception {
|
public void testGetStreamsErrors() throws Exception {
|
||||||
assertTrue("errors during stream list extraction", extractor.getStreams().getErrors().isEmpty());
|
assertEmptyErrors("errors during stream list extraction", extractor.getStreams().getErrors());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in a new issue