Example #1
0
async def test_get_device_not_adopted_enabled(protect_client: ProtectApiClient, camera):
    camera["isAdopted"] = False
    protect_client.ignore_unadopted = False
    protect_client.api_request_obj = AsyncMock(return_value=camera)  # type: ignore

    obj = create_from_unifi_dict(camera)
    assert obj == await protect_client.get_camera("test_id")
Example #2
0
async def test_get_devices_not_adopted_enabled(protect_client: ProtectApiClient, cameras):
    cameras[0]["isAdopted"] = False
    protect_client.ignore_unadopted = False
    protect_client.api_request_list = AsyncMock(return_value=cameras)  # type: ignore

    assert len(await protect_client.get_cameras()) == len(cameras)