@@ -295,7 +295,6 @@ def test_refresh_access_codes(
295
295
call ("get" , "devices/__wifi_uuid__/storage/accesscode" ),
296
296
]
297
297
)
298
- notification ._device = lock
299
298
notification .device_type = lock .device_type
300
299
want_code = AccessCode .from_json (mock_auth , lock , access_code_json )
301
300
want_code .device_id = lock .device_id
@@ -450,30 +449,35 @@ def test_fetches_logs_no_logs(self, wifi_lock: Lock) -> None:
450
449
with patch .object (wifi_lock , "logs" ) as logs_mock :
451
450
logs_mock .return_value = []
452
451
assert wifi_lock .keypad_disabled () is False
453
- wifi_lock . logs .assert_called_once_with ()
452
+ logs_mock .assert_called_once_with ()
454
453
455
454
456
455
class TestChangedBy :
457
456
def test_thumbturn (self , wifi_lock : Lock ) -> None :
457
+ assert wifi_lock .lock_state_metadata is not None
458
458
wifi_lock .lock_state_metadata .action_type = "thumbTurn"
459
459
assert wifi_lock .last_changed_by () == "thumbturn"
460
460
461
461
def test_nfc_device (self , wifi_lock : Lock ) -> None :
462
+ assert wifi_lock .lock_state_metadata is not None
462
463
wifi_lock .lock_state_metadata .action_type = "AppleHomeNFC"
463
464
wifi_lock .lock_state_metadata .uuid = "user-uuid"
464
465
assert wifi_lock .last_changed_by () == "apple nfc device - asdf"
465
466
466
467
def test_nfc_device_no_uuid (self , wifi_lock : Lock ) -> None :
468
+ assert wifi_lock .lock_state_metadata is not None
467
469
wifi_lock .lock_state_metadata .action_type = "AppleHomeNFC"
468
470
wifi_lock .lock_state_metadata .uuid = None
469
471
assert wifi_lock .last_changed_by () == "apple nfc device"
470
472
471
473
def test_keypad (self , wifi_lock : Lock ) -> None :
474
+ assert wifi_lock .lock_state_metadata is not None
472
475
wifi_lock .lock_state_metadata .action_type = "accesscode"
473
476
wifi_lock .lock_state_metadata .name = "secret code"
474
477
assert wifi_lock .last_changed_by () == "keypad - secret code"
475
478
476
479
def test_mobile_device (self , wifi_lock : Lock ) -> None :
480
+ assert wifi_lock .lock_state_metadata is not None
477
481
wifi_lock .lock_state_metadata .action_type = "virtualKey"
478
482
wifi_lock .lock_state_metadata .uuid = "user-uuid"
479
483
assert wifi_lock .last_changed_by () == "mobile device - asdf"
0 commit comments