Skip to content

Commit

Permalink
avoid error in debug log mode and rss entry without title (#16316)
Browse files Browse the repository at this point in the history
  • Loading branch information
exxamalte authored and balloob committed Aug 31, 2018
1 parent b43c47c commit 26d39d3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/feedreader.py
Expand Up @@ -143,7 +143,7 @@ def _update_and_fire_entry(self, entry):
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)

Expand All @@ -164,7 +164,7 @@ def _publish_new_entries(self):
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
Expand Down
6 changes: 3 additions & 3 deletions tests/components/test_feedreader.py
Expand Up @@ -160,11 +160,11 @@ def test_feed_max_length(self):
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."""
Expand Down
5 changes: 5 additions & 0 deletions tests/fixtures/feedreader3.xml
Expand Up @@ -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>

0 comments on commit 26d39d3

Please sign in to comment.