Fix some test source code

This commit is contained in:
Coffeemakr 2017-11-25 03:42:31 +01:00
parent d59618d0e7
commit 239df49df3
No known key found for this signature in database
GPG key ID: 3F35676D8FF6E743
2 changed files with 3 additions and 12 deletions

View file

@ -1,6 +1,5 @@
package org.schabi.newpipe.extractor.services.youtube;
import com.grack.nanojson.JsonParserException;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

View file

@ -31,6 +31,7 @@ import static junit.framework.TestCase.assertFalse;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmptyErrors;
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
@ -68,21 +69,12 @@ public class YoutubeTrendingExtractorTest {
@Test
public void testGetStreams() throws Exception {
StreamInfoItemCollector collector = extractor.getStreams();
if(!collector.getErrors().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());
assertTrue("no streams are received", collector.getItemList().isEmpty());
}
@Test
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