def test_get_lock_door_status_with_unknown_response(self, mock): lock_id = 1234 mock.register_uri( "get", API_GET_LOCK_STATUS_URL.format(lock_id=lock_id), text='{"doorState": "not_advertising"}', ) api = Api() door_status = api.get_lock_door_status(ACCESS_TOKEN, lock_id) self.assertEqual(LockDoorStatus.UNKNOWN, door_status)
def test_get_lock_door_status_with_open_response(self, mock): lock_id = 1234 mock.register_uri( "get", API_GET_LOCK_STATUS_URL.format(lock_id=lock_id), text='{"doorState": "kAugLockDoorState_Open"}', ) api = Api() door_status = api.get_lock_door_status(ACCESS_TOKEN, lock_id) self.assertEqual(LockDoorStatus.OPEN, door_status)