Add GDACS feed integration (#31235)
* initial version of gdacs integration * updated translations * generated files * added abbreviation * bumped library version * small feed entry attribute fixes * add unit tests * need to use original mdi name * bumped library version * improved entity name for earthquakes * round vulnerability number * typo * support for categories * testing support for categories * tie longitude and latitude together * validating categories * simplifying setup * passing domain as parameter * simplified test setup * moved test code * simplified test code * removed superfluous code * changed approach to unique identifier * changed code structure * simplified unit system handling * made schema a constant * comment added * simplifying code * added message if location already configured * removed unnecessary code * simplified test code * avoid mocking __init__ * pylint * simplified code * fetch categories from integration library * setting PARALLEL_UPDATES * setting PARALLEL_UPDATES to zero/unlimited * added quality scale
This commit is contained in:
1 parent
05b3c1f17d
commit
8d429d7676
18 files changed
+1240
No files matched your search
@@ -0,0 +1,19 @@
|
||||
"""Define tests for the GDACS general setup."""
|
||||
from asynctest import patch
|
||||
|
||||
from homeassistant.components.gdacs import DOMAIN, FEED
|
||||
|
||||
|
||||
async def test_component_unload_config_entry(hass, config_entry):
|
||||
"""Test that loading and unloading of a config entry works."""
|
||||
config_entry.add_to_hass(hass)
|
||||
with patch("aio_georss_gdacs.GdacsFeedManager.update") as mock_feed_manager_update:
|
||||
# Load config entry.
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
assert mock_feed_manager_update.call_count == 1
|
||||
assert hass.data[DOMAIN][FEED][config_entry.entry_id] is not None
|
||||
# Unload config entry.
|
||||
assert await hass.config_entries.async_unload(config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
assert hass.data[DOMAIN][FEED].get(config_entry.entry_id) is None
|
||||
Reference in new issue
Block a user