From dd3101e16174505f081d60b212e6711506b9d4b7 Mon Sep 17 00:00:00 2001 From: Sid <27780930+autinerd@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:01:24 +0100 Subject: [PATCH] Fix unifiprotect tests for ruff B018 (#113584) --- tests/components/unifiprotect/test_init.py | 1 - tests/components/unifiprotect/test_views.py | 18 +++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/tests/components/unifiprotect/test_init.py b/tests/components/unifiprotect/test_init.py index 35477f1e56d..681f22b327e 100644 --- a/tests/components/unifiprotect/test_init.py +++ b/tests/components/unifiprotect/test_init.py @@ -70,7 +70,6 @@ async def test_setup_multiple( nvr = bootstrap.nvr nvr._api = ufp.api nvr.mac = "A1E00C826983" - nvr.id ufp.api.get_nvr = AsyncMock(return_value=nvr) with patch( diff --git a/tests/components/unifiprotect/test_views.py b/tests/components/unifiprotect/test_views.py index 2952509fea9..fb24b399124 100644 --- a/tests/components/unifiprotect/test_views.py +++ b/tests/components/unifiprotect/test_views.py @@ -37,7 +37,7 @@ async def test_thumbnail_bad_nvr_id( response = cast(ClientResponse, await http_client.get(url)) assert response.status == 404 - ufp.api.get_event_thumbnail.assert_not_called + ufp.api.get_event_thumbnail.assert_not_called() @pytest.mark.parametrize(("width", "height"), [("test", None), (None, "test")]) @@ -62,7 +62,7 @@ async def test_thumbnail_bad_params( response = cast(ClientResponse, await http_client.get(url)) assert response.status == 400 - ufp.api.get_event_thumbnail.assert_not_called + ufp.api.get_event_thumbnail.assert_not_called() async def test_thumbnail_bad_event( @@ -259,7 +259,7 @@ async def test_video_bad_nvr_id( response = cast(ClientResponse, await http_client.get(url)) assert response.status == 404 - ufp.api.request.assert_not_called + ufp.api.request.assert_not_called() async def test_video_bad_camera_id( @@ -293,7 +293,7 @@ async def test_video_bad_camera_id( response = cast(ClientResponse, await http_client.get(url)) assert response.status == 404 - ufp.api.request.assert_not_called + ufp.api.request.assert_not_called() async def test_video_bad_camera_perms( @@ -329,7 +329,7 @@ async def test_video_bad_camera_perms( response = cast(ClientResponse, await http_client.get(url)) assert response.status == 403 - ufp.api.request.assert_not_called + ufp.api.request.assert_not_called() @pytest.mark.parametrize(("start", "end"), [("test", None), (None, "test")]) @@ -369,7 +369,7 @@ async def test_video_bad_params( response = cast(ClientResponse, await http_client.get(url)) assert response.status == 400 - ufp.api.request.assert_not_called + ufp.api.request.assert_not_called() async def test_video_bad_video( @@ -403,7 +403,7 @@ async def test_video_bad_video( response = cast(ClientResponse, await http_client.get(url)) assert response.status == 404 - ufp.api.request.assert_called_once + ufp.api.request.assert_called_once() async def test_video( @@ -446,7 +446,7 @@ async def test_video( assert await response.content.read() == b"testtest" assert response.status == 200 - ufp.api.request.assert_called_once + ufp.api.request.assert_called_once() async def test_video_entity_id( @@ -490,4 +490,4 @@ async def test_video_entity_id( assert await response.content.read() == b"testtest" assert response.status == 200 - ufp.api.request.assert_called_once + ufp.api.request.assert_called_once()