Post merge review for Feedreader (#122327)

* remove unneccessary typing

* assert type list while type checking

* remove summary, since feedparser parse it already into content

* add further tests
This commit is contained in:
Michael 2024-07-21 20:55:02 +02:00 committed by GitHub
parent 94ce02f406
commit 7e1fb88e4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 91 additions and 6 deletions

View file

@ -165,6 +165,21 @@ async def test_feed_identical_timestamps(
)
async def test_feed_with_only_summary(
hass: HomeAssistant, events, feed_only_summary
) -> None:
"""Test simple feed with only summary, no content."""
assert await async_setup_config_entry(
hass, VALID_CONFIG_DEFAULT, return_value=feed_only_summary
)
await hass.async_block_till_done()
assert len(events) == 1
assert events[0].data.title == "Title 1"
assert events[0].data.description == "Description 1"
assert events[0].data.content[0].value == "This is a summary"
async def test_feed_updates(
hass: HomeAssistant, events, feed_one_event, feed_two_event
) -> None:
@ -247,6 +262,20 @@ async def test_feed_with_unrecognized_publication_date(
assert len(events) == 1
async def test_feed_without_items(
hass: HomeAssistant, events, feed_without_items, caplog: pytest.LogCaptureFixture
) -> None:
"""Test simple feed without any items."""
assert "No new entries to be published in feed" not in caplog.text
assert await async_setup_config_entry(
hass, VALID_CONFIG_DEFAULT, return_value=feed_without_items
)
await hass.async_block_till_done()
assert "No new entries to be published in feed" in caplog.text
assert len(events) == 0
async def test_feed_invalid_data(hass: HomeAssistant, events) -> None:
"""Test feed with invalid data."""
assert await async_setup_config_entry(