mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-27 15:30:34 +05:30
Add test for subscriptions with empty title.
(youtube subscription extractor)
This commit is contained in:
parent
03893abd91
commit
d5043cdf49
@ -59,6 +59,23 @@ public class YoutubeSubscriptionExtractorTest {
|
|||||||
assertTrue(items.isEmpty());
|
assertTrue(items.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSubscriptionWithEmptyTitleInSource() throws Exception {
|
||||||
|
String channelName = "NAME OF CHANNEL";
|
||||||
|
String emptySource = "<opml version=\"1.1\"><body><outline text=\"YouTube Subscriptions\" title=\"YouTube Subscriptions\">" +
|
||||||
|
|
||||||
|
"<outline text=\"\" title=\"\" type=\"rss\" xmlUrl=\"https://www.youtube.com/feeds/videos.xml?channel_id=AA0AaAa0AaaaAAAAAA0aa0AA\" />" +
|
||||||
|
|
||||||
|
"<outline text=\"" + channelName + "\" title=\"" + channelName +
|
||||||
|
"\" type=\"rss\" xmlUrl=\"https://www.youtube.com/feeds/videos.xml?channel_id=AA0AaAa0AaaaAAAAAA0aa0AA\" />" +
|
||||||
|
|
||||||
|
"</outline></body></opml>";
|
||||||
|
|
||||||
|
List<SubscriptionItem> items = subscriptionExtractor.fromInputStream(new ByteArrayInputStream(emptySource.getBytes("UTF-8")));
|
||||||
|
assertTrue("List doesn't have exactly 1 item (had " + items.size() + ")", items.size() == 1);
|
||||||
|
assertTrue("Item does not have the right title \"" + channelName + "\" (had \"" + items.get(0).getName() + "\")", items.get(0).getName().equals(channelName));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInvalidSourceException() {
|
public void testInvalidSourceException() {
|
||||||
List<String> invalidList = Arrays.asList(
|
List<String> invalidList = Arrays.asList(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user