Skip to content

Commit

Permalink
Tests: remove obsolete pending_reset tests.
Browse files Browse the repository at this point in the history
pending_reset was removed years ago when the integration was changed
to be push by default rather than polled.
The tests continued to work because the initial cached_state with just an
updated_at entry caused has_returned_state to return false.
Since that condition was changed in the last commit to support devices
that do not return any state, the tests now fail. Since they are obsolete,
it is better to remove them than update.
  • Loading branch information
make-all committed Jan 10, 2025
1 parent c885246 commit 7eae656
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions tests/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,6 @@ async def test_detection_returns_none_when_device_type_not_detected(self):
self.subject._cached_state = {"192": False, "updated_at": time()}
self.assertEqual(await self.subject.async_inferred_type(), None)

async def test_refreshes_when_there_is_no_pending_reset(self):
self.subject._cached_state = {"updated_at": time() - 19}
self.mock_api().status.return_value = {"dps": {"1": "called"}}

await self.subject.async_refresh()

self.mock_api().status.assert_called_once()
self.assertEqual(self.subject._cached_state["1"], "called")

async def test_refreshes_when_there_is_expired_pending_reset(self):
self.subject._cached_state = {"updated_at": time() - 20}
self.mock_api().status.return_value = {"dps": {"1": "called"}}

await self.subject.async_refresh()

self.mock_api().status.assert_called_once()
self.assertEqual(self.subject._cached_state["1"], "called")

async def test_refresh_retries_up_to_eleven_times(self):
self.subject._api_protocol_working = False
self.mock_api().status.side_effect = [
Expand Down

0 comments on commit 7eae656

Please sign in to comment.