Skip to content

Commit 601e29c

Browse files
committed
Fix mypy errors
1 parent 3cd9ed7 commit 601e29c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/test_lock.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ def test_refresh_access_codes(
295295
call("get", "devices/__wifi_uuid__/storage/accesscode"),
296296
]
297297
)
298-
notification._device = lock
299298
notification.device_type = lock.device_type
300299
want_code = AccessCode.from_json(mock_auth, lock, access_code_json)
301300
want_code.device_id = lock.device_id
@@ -450,30 +449,35 @@ def test_fetches_logs_no_logs(self, wifi_lock: Lock) -> None:
450449
with patch.object(wifi_lock, "logs") as logs_mock:
451450
logs_mock.return_value = []
452451
assert wifi_lock.keypad_disabled() is False
453-
wifi_lock.logs.assert_called_once_with()
452+
logs_mock.assert_called_once_with()
454453

455454

456455
class TestChangedBy:
457456
def test_thumbturn(self, wifi_lock: Lock) -> None:
457+
assert wifi_lock.lock_state_metadata is not None
458458
wifi_lock.lock_state_metadata.action_type = "thumbTurn"
459459
assert wifi_lock.last_changed_by() == "thumbturn"
460460

461461
def test_nfc_device(self, wifi_lock: Lock) -> None:
462+
assert wifi_lock.lock_state_metadata is not None
462463
wifi_lock.lock_state_metadata.action_type = "AppleHomeNFC"
463464
wifi_lock.lock_state_metadata.uuid = "user-uuid"
464465
assert wifi_lock.last_changed_by() == "apple nfc device - asdf"
465466

466467
def test_nfc_device_no_uuid(self, wifi_lock: Lock) -> None:
468+
assert wifi_lock.lock_state_metadata is not None
467469
wifi_lock.lock_state_metadata.action_type = "AppleHomeNFC"
468470
wifi_lock.lock_state_metadata.uuid = None
469471
assert wifi_lock.last_changed_by() == "apple nfc device"
470472

471473
def test_keypad(self, wifi_lock: Lock) -> None:
474+
assert wifi_lock.lock_state_metadata is not None
472475
wifi_lock.lock_state_metadata.action_type = "accesscode"
473476
wifi_lock.lock_state_metadata.name = "secret code"
474477
assert wifi_lock.last_changed_by() == "keypad - secret code"
475478

476479
def test_mobile_device(self, wifi_lock: Lock) -> None:
480+
assert wifi_lock.lock_state_metadata is not None
477481
wifi_lock.lock_state_metadata.action_type = "virtualKey"
478482
wifi_lock.lock_state_metadata.uuid = "user-uuid"
479483
assert wifi_lock.last_changed_by() == "mobile device - asdf"

0 commit comments

Comments
 (0)