Address late review of nsw fuel station (#51619)
This commit is contained in:
parent
fa42c676bb
commit
3fa6c97801
2 changed files with 4 additions and 6 deletions
|
@ -7,7 +7,7 @@ import logging
|
|||
|
||||
from nsw_fuel import FuelCheckClient, FuelCheckError, Station
|
||||
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||
|
||||
from .const import DATA_NSW_FUEL_STATION
|
||||
|
||||
|
@ -60,5 +60,6 @@ def fetch_station_price_data(client: FuelCheckClient) -> StationPriceData | None
|
|||
)
|
||||
|
||||
except FuelCheckError as exc:
|
||||
_LOGGER.error("Failed to fetch NSW Fuel station price data. %s", exc)
|
||||
return None
|
||||
raise UpdateFailed(
|
||||
f"Failed to fetch NSW Fuel station price data: {exc}"
|
||||
) from exc
|
||||
|
|
|
@ -75,7 +75,6 @@ MOCK_FUEL_PRICES_RESPONSE = MockGetFuelPricesResponse(
|
|||
)
|
||||
async def test_setup(get_fuel_prices, hass):
|
||||
"""Test the setup with custom settings."""
|
||||
assert await async_setup_component(hass, DOMAIN, {})
|
||||
with assert_setup_component(1, sensor.DOMAIN):
|
||||
assert await async_setup_component(
|
||||
hass, sensor.DOMAIN, {"sensor": VALID_CONFIG}
|
||||
|
@ -98,7 +97,6 @@ def raise_fuel_check_error():
|
|||
)
|
||||
async def test_setup_error(get_fuel_prices, hass):
|
||||
"""Test the setup with client throwing error."""
|
||||
assert await async_setup_component(hass, DOMAIN, {})
|
||||
with assert_setup_component(1, sensor.DOMAIN):
|
||||
assert await async_setup_component(
|
||||
hass, sensor.DOMAIN, {"sensor": VALID_CONFIG}
|
||||
|
@ -116,7 +114,6 @@ async def test_setup_error(get_fuel_prices, hass):
|
|||
)
|
||||
async def test_setup_error_no_station(get_fuel_prices, hass):
|
||||
"""Test the setup with specified station not existing."""
|
||||
assert await async_setup_component(hass, DOMAIN, {})
|
||||
with assert_setup_component(2, sensor.DOMAIN):
|
||||
assert await async_setup_component(
|
||||
hass,
|
||||
|
|
Loading…
Add table
Reference in a new issue