Skip to content

Commit

Permalink
Fix retry test in sync module
Browse files Browse the repository at this point in the history
  • Loading branch information
mkmer committed Sep 17, 2023
1 parent 363cad2 commit 5e87d66
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_sync_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ async def test_check_malformed_clips_with_update_local_storage_manifest(
self.assertIsNone(await test_sync.update_local_storage_manifest())

async def test_check_poll_local_storage_manifest_retry(self, mock_resp) -> None:
"""Test checking poll local storage manifest retry."""
"""Test checking poll local storage manifest retry logic."""
self.blink.account_id = 10111213
test_sync = self.blink.sync["test"]
test_sync._local_storage["status"] = True
Expand All @@ -470,16 +470,17 @@ async def test_check_poll_local_storage_manifest_retry(self, mock_resp) -> None:
test_sync.cameras["Front_Door"] = MockCamera(self.blink.sync)

mock_resp.side_effect = [
{"bad": "stuff"}, # bad command response, fall back to retry logic
COMMAND_RESPONSE,
COMMAND_COMPLETE,
]
test_sync._names_table[to_alphanumeric("Front_Door")] = "Front_Door"
test_sync._names_table[to_alphanumeric("Back Door")] = "Back Door"

response = await test_sync.poll_local_storage_manifest(max_retries=1)
response = await test_sync.poll_local_storage_manifest(max_retries=2)
self.assertEqual(
response,
{"network_id": "12345", "id": "54321"},
COMMAND_RESPONSE,
)

async def test_sync_owl_init(self, mock_resp):
Expand Down

0 comments on commit 5e87d66

Please sign in to comment.