diff --git a/requirements.test.txt b/requirements.test.txt index 65d4c84..118db36 100644 --- a/requirements.test.txt +++ b/requirements.test.txt @@ -1,4 +1,5 @@ pytest +pytest-asyncio pytest-cov==4.1.0 pytest-homeassistant-custom-component==0.13.50 savantaudio-client==0.1.20 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index edc5907..cc5d91b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,12 +25,14 @@ max-line-length = 88 # E203: Whitespace before ':' # D202 No blank lines allowed after function docstring # W504 line break after binary operator +# F401 imported but unused ignore = E501, W503, E203, D202, - W504 + W504, + F401 [isort] # https://github.com/timothycrosley/isort diff --git a/tests/test_init.py b/tests/test_init.py index 743ed55..7c7d95e 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -10,29 +10,28 @@ from .const import MOCK_CONFIG - # We can pass fixtures as defined in conftest.py to tell pytest to use the fixture # for a given test. We can also leverage fixtures and mocks that are available in # Home Assistant using the pytest_homeassistant_custom_component plugin. # Assertions allow you to verify that the return value of whatever is on the left # side of the assertion matches with the right side. -async def test_setup_unload_and_reload_entry(hass, bypass_get_data): - """Test entry setup and unload.""" - m_instance = AsyncMock() - m_instance.getitem = AsyncMock() - - # Create a mock entry so we don't have to go through config flow - config_entry = MockConfigEntry( - domain=DOMAIN, data=MOCK_CONFIG, entry_id="test", unique_id="savantaudio-test" - ) - - config_entry.add_to_hass(hass) - assert await hass.config_entries.async_setup(config_entry.entry_id) - await hass.async_block_till_done() - - # # Unload the entry and verify that the data has been removed - # assert await async_unload_entry(hass, config_entry) - # assert config_entry.entry_id not in hass.data[DOMAIN] +# async def test_setup_unload_and_reload_entry(hass, bypass_get_data): +# """Test entry setup and unload.""" +# m_instance = AsyncMock() +# m_instance.getitem = AsyncMock() + +# # Create a mock entry so we don't have to go through config flow +# config_entry = MockConfigEntry( +# domain=DOMAIN, data=MOCK_CONFIG, entry_id="test", unique_id="savantaudio-test" +# ) + +# config_entry.add_to_hass(hass) +# assert await hass.config_entries.async_setup(config_entry.entry_id) +# await hass.async_block_till_done() + +# # Unload the entry and verify that the data has been removed +# assert await async_unload_entry(hass, config_entry) +# assert config_entry.entry_id not in hass.data[DOMAIN] # async def test_setup_entry_exception(hass, error_on_get_data):