Fix tests and add setup type in feedreader (#64280)
* Fix feedreader tests * Cleanup * Add setup type hints Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
85c6a24665
commit
b9d3bb4cfd
2 changed files with 11 additions and 15 deletions
|
@ -1,9 +1,7 @@
|
|||
"""The tests for the feedreader component."""
|
||||
from datetime import timedelta
|
||||
from os import remove
|
||||
from os.path import exists
|
||||
from unittest import mock
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import mock_open, patch
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -65,14 +63,10 @@ async def fixture_events(hass):
|
|||
|
||||
|
||||
@pytest.fixture(name="feed_storage", autouse=True)
|
||||
def fixture_feed_storage(hass):
|
||||
"""Create storage account for feedreader."""
|
||||
data_file = hass.config.path(f"{feedreader.DOMAIN}.pickle")
|
||||
|
||||
yield
|
||||
|
||||
if exists(data_file):
|
||||
remove(data_file)
|
||||
def fixture_feed_storage():
|
||||
"""Mock builtins.open for feedreader storage."""
|
||||
with patch("homeassistant.components.feedreader.open", mock_open(), create=True):
|
||||
yield
|
||||
|
||||
|
||||
async def test_setup_one_feed(hass):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue