Fix unifiprotect tests for ruff B018 (#113584)
parent
eb90c9a548
commit
dd3101e161
|
@ -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(
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue