Skip to content

Commit

Permalink
Added some useful but missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fronzbot committed Jun 26, 2022
1 parent 34a1d87 commit e8af309
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_sync_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,3 +373,15 @@ def test_sync_with_mixed_cameras(self, mock_resp):
self.assertEqual(
test_sync.cameras["fake"].__class__, BlinkDoorbell, msg=debug_msg
)

def test_name_not_in_config(self, mock_resp):
"""Check that function exits when name not in camera_config."""
test_sync = self.blink.sync["test"]
test_sync.camera_list = [{"foo": "bar"}]
self.assertTrue(test_sync.update_cameras())

def test_camera_config_key_error(self, mock_resp):
"""Check that update returns False on KeyError."""
test_sync = self.blink.sync["test"]
test_sync.camera_list = [{"name": "foobar"}]
self.assertFalse(test_sync.update_cameras())

0 comments on commit e8af309

Please sign in to comment.