avoid error in debug log mode and rss entry without title (#16316)

This commit is contained in:
Malte Franken 2018-08-31 20:54:25 +10:00 committed by Paulus Schoutsen
parent b43c47cb17
commit 26d39d39ea
3 changed files with 10 additions and 5 deletions

View file

@ -143,7 +143,7 @@ class FeedManager:
else:
self._has_published_parsed = False
_LOGGER.debug("No published_parsed info available for entry %s",
entry.title)
entry)
entry.update({'feed_url': self._url})
self._hass.bus.fire(self._event_type, entry)
@ -164,7 +164,7 @@ class FeedManager:
self._update_and_fire_entry(entry)
new_entries = True
else:
_LOGGER.debug("Entry %s already processed", entry.title)
_LOGGER.debug("Entry %s already processed", entry)
if not new_entries:
self._log_no_entries()
self._firstrun = False

View file

@ -160,11 +160,11 @@ class TestFeedreaderComponent(unittest.TestCase):
manager, events = self.setup_manager(feed_data, max_entries=5)
assert len(events) == 5
def test_feed_without_publication_date(self):
"""Test simple feed with entry without publication date."""
def test_feed_without_publication_date_and_title(self):
"""Test simple feed with entry without publication date and title."""
feed_data = load_fixture('feedreader3.xml')
manager, events = self.setup_manager(feed_data)
assert len(events) == 2
assert len(events) == 3
def test_feed_invalid_data(self):
"""Test feed with invalid data."""

View file

@ -21,6 +21,11 @@
<link>http://www.example.com/link/2</link>
<guid isPermaLink="false">GUID 2</guid>
</item>
<item>
<description>Description 3</description>
<link>http://www.example.com/link/3</link>
<guid isPermaLink="false">GUID 3</guid>
</item>
</channel>
</rss>