Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jhansche committed Jan 11, 2025
1 parent b53fdb8 commit 71cf342
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
3 changes: 2 additions & 1 deletion requirements.test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ pytest-cov
pytest-aiohttp
pytest-asyncio
pytest-unordered
py==1.10.0 # Fixes pytest-sugar 0.9.5
py
propcache
6 changes: 2 additions & 4 deletions tests/test_device_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ async def test_does_not_fire_on_postcard_event_for_other_feeder(hass, calls):

async def test_config_schema(hass, device_reg):
"""Test we get the expected triggers from a birdbuddy."""
config_entry = MockConfigEntry(domain="birdbuddy", data={})
config_entry = MockConfigEntry(domain="birdbuddy", data={}, state=ConfigEntryState.LOADED)
config_entry.add_to_hass(hass)
config_entry.state = ConfigEntryState.LOADED
device_entry = device_reg.async_get_or_create(
config_entry_id=config_entry.entry_id,
identifiers={(DOMAIN, "feeder1")},
Expand All @@ -125,9 +124,8 @@ async def test_config_schema(hass, device_reg):

async def test_config_schema_no_coordinator(hass, device_reg):
"""Test we get the expected triggers from a birdbuddy."""
config_entry = MockConfigEntry(domain="birdbuddy", data={})
config_entry = MockConfigEntry(domain="birdbuddy", data={}, state=ConfigEntryState.LOADED)
config_entry.add_to_hass(hass)
config_entry.state = ConfigEntryState.LOADED
device_entry = device_reg.async_get_or_create(
config_entry_id=config_entry.entry_id,
identifiers={(DOMAIN, "feeder1")},
Expand Down
9 changes: 3 additions & 6 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ async def test_setup_entry(hass: HomeAssistant):
"email": "[email protected]",
"password": "test-password",
}
config_entry = MockConfigEntry(domain="birdbuddy", data=config)
config_entry = MockConfigEntry(domain="birdbuddy", data=config, state=ConfigEntryState.NOT_LOADED)
config_entry.add_to_hass(hass)
config_entry.state = ConfigEntryState.NOT_LOADED

with patch(
"birdbuddy.client.BirdBuddy.refresh",
Expand All @@ -44,9 +43,8 @@ async def test_setup_entry_no_feeders(hass: HomeAssistant):
"email": "[email protected]",
"password": "test-password",
}
config_entry = MockConfigEntry(domain="birdbuddy", data=config)
config_entry = MockConfigEntry(domain="birdbuddy", data=config, state=ConfigEntryState.NOT_LOADED)
config_entry.add_to_hass(hass)
config_entry.state = ConfigEntryState.NOT_LOADED

with patch(
"birdbuddy.client.BirdBuddy.refresh",
Expand All @@ -64,9 +62,8 @@ async def test_setup_entry_refresh_fails(hass: HomeAssistant):
"email": "[email protected]",
"password": "test-password",
}
config_entry = MockConfigEntry(domain="birdbuddy", data=config)
config_entry = MockConfigEntry(domain="birdbuddy", data=config, state=ConfigEntryState.NOT_LOADED)
config_entry.add_to_hass(hass)
config_entry.state = ConfigEntryState.NOT_LOADED

with patch(
"birdbuddy.client.BirdBuddy.refresh",
Expand Down

0 comments on commit 71cf342

Please sign in to comment.