1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-10-25 12:27:38 +00:00

fixed viewcount failure

This commit is contained in:
Christian Schabesberger
2016-02-24 16:44:46 +01:00
parent 5d8f75beb4
commit 3441aceba3
7 changed files with 21 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
package org.schabi.newpipe.services.youtube;
package org.schabi.newpipe.extractor.youtube;
import android.test.AndroidTestCase;
@@ -82,9 +82,16 @@ public class YoutubeSearchEngineTest extends AndroidTestCase {
}
public void testViewCount() {
/*
for(VideoPreviewInfo i : result.resultList) {
assertTrue(Long.toString(i.view_count), i.view_count != -1);
}
*/
// that specific link used for this test, there are no videos with less
// than 10.000 views, so we can test against that.
for(VideoPreviewInfo i : result.resultList) {
assertTrue(Long.toString(i.view_count), i.view_count >= 10000);
}
}
public void testIfSuggestionsAreReplied() {

View File

@@ -1,4 +1,4 @@
package org.schabi.newpipe.services.youtube;
package org.schabi.newpipe.extractor.youtube;
import android.test.AndroidTestCase;
@@ -70,8 +70,9 @@ public class YoutubeStreamExtractorDefaultTest extends AndroidTestCase {
assertTrue(extractor.getLength() > 0);
}
public void testGetViews() throws ParsingException {
assertTrue(extractor.getLength() > 0);
public void testGetViewCount() throws ParsingException {
assertTrue(Long.toString(extractor.getViewCount()),
extractor.getViewCount() > /* specific to that video */ 1224000074);
}
public void testGetUploadDate() throws ParsingException {

View File

@@ -1,4 +1,4 @@
package org.schabi.newpipe.services.youtube;
package org.schabi.newpipe.extractor.youtube;
import android.test.AndroidTestCase;