mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-28 16:00:33 +05:30
Fix tests again.
This commit is contained in:
parent
88c11db4c5
commit
f4aad8b014
@ -147,8 +147,10 @@ public class YoutubeMusicSearchExtractor extends SearchExtractor {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean corrected = itemSectionRenderer.getArray("contents").getObject(0)
|
JsonObject firstContent = itemSectionRenderer.getArray("contents").getObject(0);
|
||||||
.has("didYouMeanRenderer");
|
|
||||||
|
final boolean corrected = firstContent
|
||||||
|
.has("didYouMeanRenderer") || firstContent.has("showingResultsForRenderer");
|
||||||
return corrected;
|
return corrected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ public class YoutubeMusicSearchExtractorTest {
|
|||||||
public static class Suggestion extends DefaultSearchExtractorTest {
|
public static class Suggestion extends DefaultSearchExtractorTest {
|
||||||
private static SearchExtractor extractor;
|
private static SearchExtractor extractor;
|
||||||
private static final String QUERY = "megaman x3";
|
private static final String QUERY = "megaman x3";
|
||||||
|
private static final boolean CORRECTED = true;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setUp() throws Exception {
|
public static void setUp() throws Exception {
|
||||||
@ -150,6 +151,7 @@ public class YoutubeMusicSearchExtractorTest {
|
|||||||
@Override public String expectedSearchString() { return QUERY; }
|
@Override public String expectedSearchString() { return QUERY; }
|
||||||
@Nullable @Override public String expectedSearchSuggestion() { return "mega man x3"; }
|
@Nullable @Override public String expectedSearchSuggestion() { return "mega man x3"; }
|
||||||
@Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.STREAM; }
|
@Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.STREAM; }
|
||||||
|
@Override public boolean isCorrectedSearch() { return CORRECTED; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class CorrectedSearch extends DefaultSearchExtractorTest {
|
public static class CorrectedSearch extends DefaultSearchExtractorTest {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user