Skip to content

Commit 7f11b44

Browse files
committed
[YouTube] Remove YoutubeSearchExtractorTest.Suggestion
Searches are now always corrected by YouTube, which provides a way to still search for the input term. In this case, a "Did you mean" message will be shown. The extractor doesn't support the ability to search on the input term instead of the corrected search, at least for now. As mocks have to be updated due to the addition of the Content-Type header, the test will always fail, even in MockOnly mode, due to the reasons mentioned above, so it should be removed.
1 parent 82e3dc7 commit 7f11b44

File tree

4 files changed

+0
-1394
lines changed

4 files changed

+0
-1394
lines changed

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeSearchExtractorTest.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.junit.jupiter.api.BeforeAll;
1616
import org.junit.jupiter.api.Test;
1717
import org.schabi.newpipe.downloader.DownloaderFactory;
18-
import org.schabi.newpipe.downloader.MockOnly;
1918
import org.schabi.newpipe.extractor.InfoItem;
2019
import org.schabi.newpipe.extractor.ListExtractor;
2120
import org.schabi.newpipe.extractor.MetaInfo;
@@ -136,31 +135,6 @@ public static void setUp() throws Exception {
136135
@Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.STREAM; }
137136
}
138137

139-
@MockOnly("Currently constantly switching between \"Did you mean\" and \"Showing results for ...\" occurs")
140-
public static class Suggestion extends DefaultSearchExtractorTest {
141-
private static SearchExtractor extractor;
142-
private static final String QUERY = "newpip";
143-
private static final String EXPECTED_SUGGESTION = "newpipe";
144-
145-
@BeforeAll
146-
public static void setUp() throws Exception {
147-
YoutubeTestsUtils.ensureStateless();
148-
NewPipe.init(DownloaderFactory.getDownloader(RESOURCE_PATH + "suggestions"));
149-
extractor = YouTube.getSearchExtractor(QUERY, singletonList(VIDEOS), "");
150-
extractor.fetchPage();
151-
}
152-
153-
@Override public SearchExtractor extractor() { return extractor; }
154-
@Override public StreamingService expectedService() { return YouTube; }
155-
@Override public String expectedName() { return QUERY; }
156-
@Override public String expectedId() { return QUERY; }
157-
@Override public String expectedUrlContains() { return "youtube.com/results?search_query=" + QUERY; }
158-
@Override public String expectedOriginalUrlContains() { return "youtube.com/results?search_query=" + QUERY; }
159-
@Override public String expectedSearchString() { return QUERY; }
160-
@Nullable @Override public String expectedSearchSuggestion() { return EXPECTED_SUGGESTION; }
161-
@Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.STREAM; }
162-
}
163-
164138
public static class CorrectedSearch extends DefaultSearchExtractorTest {
165139
private static SearchExtractor extractor;
166140
private static final String QUERY = "pewdeipie";

extractor/src/test/resources/org/schabi/newpipe/extractor/services/youtube/extractor/search/suggestions/generated_mock_0.json

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)