Skip to content

Commit

Permalink
chore: Updated diagnostic tests to be resilient against home mini fai…
Browse files Browse the repository at this point in the history
…lures
  • Loading branch information
BottlecapDave committed Dec 21, 2024
1 parent b4b062e commit 3eff36e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tests/integration/test_async_get_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ def assert_meter(meter, expected_serial_number: int):
assert meter["device_id"] == "**REDACTED**"
assert isinstance(meter["latest_consumption"], datetime)

assert meter["device"] is not None
assert isinstance(meter["device"]["total_consumption"], float)
assert isinstance(meter["device"]["consumption"], float)
assert "demand" in meter["device"]
assert isinstance(meter["device"]["start"], datetime)
assert isinstance(meter["device"]["end"], datetime)
if meter["device"] != "Not available":
if meter["device"]["total_consumption"] is not None:
assert isinstance(meter["device"]["total_consumption"], float)

if meter["device"]["consumption"] is not None:
assert isinstance(meter["device"]["consumption"], float)

assert "demand" in meter["device"]
assert isinstance(meter["device"]["start"], datetime)
assert isinstance(meter["device"]["end"], datetime)

@pytest.mark.asyncio
async def test_when_async_get_diagnostics_called_then_account_info_is_returned():
Expand Down

0 comments on commit 3eff36e

Please sign in to comment.