From 9d921b97d0d4f0b97f46c40722e4494cabfdd0d6 Mon Sep 17 00:00:00 2001 From: Austin Tyler Conn Date: Sun, 7 Jul 2024 19:02:34 +0000 Subject: [PATCH] Fix ruff check --- blinkpy/camera.py | 2 +- tests/test_api.py | 8 ++++++++ tests/test_cameras.py | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/blinkpy/camera.py b/blinkpy/camera.py index 26c7585d..9fca2321 100644 --- a/blinkpy/camera.py +++ b/blinkpy/camera.py @@ -667,4 +667,4 @@ async def async_snooze(self): ) if res and res.status == 200: return await res.json() - return None \ No newline at end of file + return None diff --git a/tests/test_api.py b/tests/test_api.py index 89581dbc..b5afeaae 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -203,3 +203,11 @@ async def test_wait_for_command(self, mock_resp): response = await api.wait_for_command(self.blink, None) self.assertFalse(response) + + async def test_request_camera_snooze(self, mock_resp): + """Test request_camera_snooze.""" + mock_resp.return_value = mresp.MockResponse({}, 200) + response = await api.request_camera_snooze( + self.blink, "network", "camera_id", "catalina", {} + ) + self.assertEqual(response.status, 200) diff --git a/tests/test_cameras.py b/tests/test_cameras.py index 678301d0..e0daa4b8 100644 --- a/tests/test_cameras.py +++ b/tests/test_cameras.py @@ -8,12 +8,14 @@ from unittest import mock from unittest import IsolatedAsyncioTestCase +from unittest.mock import MagicMock from blinkpy.blinkpy import Blink from blinkpy.helpers.util import BlinkURLHandler from blinkpy.sync_module import BlinkSyncModule from blinkpy.camera import BlinkCamera, BlinkCameraMini, BlinkDoorbell import tests.mock_responses as mresp + CONFIG = { "name": "new", "id": 1234, @@ -176,4 +178,4 @@ async def test_new_thumb_url_returned(self, mock_resp): await self.camera.update(config, expire_clips=False) self.assertEqual( self.camera.thumbnail, f"https://rest-test.immedia-semi.com{thumb_return}" - ) + ) \ No newline at end of file