mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Bump georss-ign-sismologia-client to 0.8 (#110501)
* bump georss-ign-sismologia-client to 0.8 * fixed tests
This commit is contained in:
parent
bc5ec4f2a3
commit
d7f650ed7c
@ -6,5 +6,5 @@
|
|||||||
"integration_type": "service",
|
"integration_type": "service",
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"loggers": ["georss_ign_sismologia_client"],
|
"loggers": ["georss_ign_sismologia_client"],
|
||||||
"requirements": ["georss-ign-sismologia-client==0.6"]
|
"requirements": ["georss-ign-sismologia-client==0.8"]
|
||||||
}
|
}
|
||||||
|
@ -920,7 +920,7 @@ geopy==2.3.0
|
|||||||
georss-generic-client==0.8
|
georss-generic-client==0.8
|
||||||
|
|
||||||
# homeassistant.components.ign_sismologia
|
# homeassistant.components.ign_sismologia
|
||||||
georss-ign-sismologia-client==0.6
|
georss-ign-sismologia-client==0.8
|
||||||
|
|
||||||
# homeassistant.components.qld_bushfire
|
# homeassistant.components.qld_bushfire
|
||||||
georss-qld-bushfire-alert-client==0.5
|
georss-qld-bushfire-alert-client==0.5
|
||||||
|
@ -746,7 +746,7 @@ geopy==2.3.0
|
|||||||
georss-generic-client==0.8
|
georss-generic-client==0.8
|
||||||
|
|
||||||
# homeassistant.components.ign_sismologia
|
# homeassistant.components.ign_sismologia
|
||||||
georss-ign-sismologia-client==0.6
|
georss-ign-sismologia-client==0.8
|
||||||
|
|
||||||
# homeassistant.components.qld_bushfire
|
# homeassistant.components.qld_bushfire
|
||||||
georss-qld-bushfire-alert-client==0.5
|
georss-qld-bushfire-alert-client==0.5
|
||||||
|
@ -3,6 +3,7 @@ import datetime
|
|||||||
from unittest.mock import MagicMock, call, patch
|
from unittest.mock import MagicMock, call, patch
|
||||||
|
|
||||||
from freezegun.api import FrozenDateTimeFactory
|
from freezegun.api import FrozenDateTimeFactory
|
||||||
|
from georss_ign_sismologia_client import IgnSismologiaFeed
|
||||||
|
|
||||||
from homeassistant.components import geo_location
|
from homeassistant.components import geo_location
|
||||||
from homeassistant.components.geo_location import ATTR_SOURCE
|
from homeassistant.components.geo_location import ATTR_SOURCE
|
||||||
@ -98,8 +99,8 @@ async def test_setup(hass: HomeAssistant, freezer: FrozenDateTimeFactory) -> Non
|
|||||||
utcnow = dt_util.utcnow()
|
utcnow = dt_util.utcnow()
|
||||||
freezer.move_to(utcnow)
|
freezer.move_to(utcnow)
|
||||||
|
|
||||||
with patch("georss_ign_sismologia_client.IgnSismologiaFeed") as mock_feed:
|
with patch("georss_client.feed.GeoRssFeed.update") as mock_feed_update:
|
||||||
mock_feed.return_value.update.return_value = (
|
mock_feed_update.return_value = (
|
||||||
"OK",
|
"OK",
|
||||||
[mock_entry_1, mock_entry_2, mock_entry_3],
|
[mock_entry_1, mock_entry_2, mock_entry_3],
|
||||||
)
|
)
|
||||||
@ -170,7 +171,7 @@ async def test_setup(hass: HomeAssistant, freezer: FrozenDateTimeFactory) -> Non
|
|||||||
|
|
||||||
# Simulate an update - one existing, one new entry,
|
# Simulate an update - one existing, one new entry,
|
||||||
# one outdated entry
|
# one outdated entry
|
||||||
mock_feed.return_value.update.return_value = (
|
mock_feed_update.return_value = (
|
||||||
"OK",
|
"OK",
|
||||||
[mock_entry_1, mock_entry_4, mock_entry_3],
|
[mock_entry_1, mock_entry_4, mock_entry_3],
|
||||||
)
|
)
|
||||||
@ -182,7 +183,7 @@ async def test_setup(hass: HomeAssistant, freezer: FrozenDateTimeFactory) -> Non
|
|||||||
|
|
||||||
# Simulate an update - empty data, but successful update,
|
# Simulate an update - empty data, but successful update,
|
||||||
# so no changes to entities.
|
# so no changes to entities.
|
||||||
mock_feed.return_value.update.return_value = "OK_NO_DATA", None
|
mock_feed_update.return_value = "OK_NO_DATA", None
|
||||||
async_fire_time_changed(hass, utcnow + 2 * SCAN_INTERVAL)
|
async_fire_time_changed(hass, utcnow + 2 * SCAN_INTERVAL)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
@ -190,7 +191,7 @@ async def test_setup(hass: HomeAssistant, freezer: FrozenDateTimeFactory) -> Non
|
|||||||
assert len(all_states) == 3
|
assert len(all_states) == 3
|
||||||
|
|
||||||
# Simulate an update - empty data, removes all entities
|
# Simulate an update - empty data, removes all entities
|
||||||
mock_feed.return_value.update.return_value = "ERROR", None
|
mock_feed_update.return_value = "ERROR", None
|
||||||
async_fire_time_changed(hass, utcnow + 3 * SCAN_INTERVAL)
|
async_fire_time_changed(hass, utcnow + 3 * SCAN_INTERVAL)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
@ -203,8 +204,11 @@ async def test_setup_with_custom_location(hass: HomeAssistant) -> None:
|
|||||||
# Set up some mock feed entries for this test.
|
# Set up some mock feed entries for this test.
|
||||||
mock_entry_1 = _generate_mock_feed_entry("1234", "Title 1", 20.5, (38.1, -3.1))
|
mock_entry_1 = _generate_mock_feed_entry("1234", "Title 1", 20.5, (38.1, -3.1))
|
||||||
|
|
||||||
with patch("georss_ign_sismologia_client.IgnSismologiaFeed") as mock_feed:
|
with patch(
|
||||||
mock_feed.return_value.update.return_value = "OK", [mock_entry_1]
|
"georss_ign_sismologia_client.feed_manager.IgnSismologiaFeed",
|
||||||
|
wraps=IgnSismologiaFeed,
|
||||||
|
) as mock_feed, patch("georss_client.feed.GeoRssFeed.update") as mock_feed_update:
|
||||||
|
mock_feed_update.return_value = "OK", [mock_entry_1]
|
||||||
|
|
||||||
with assert_setup_component(1, geo_location.DOMAIN):
|
with assert_setup_component(1, geo_location.DOMAIN):
|
||||||
assert await async_setup_component(
|
assert await async_setup_component(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user