From aea5d771d42c3e8ce6904a805b26a3065deace02 Mon Sep 17 00:00:00 2001 From: mkmer Date: Fri, 12 Apr 2024 17:43:23 +0000 Subject: [PATCH] Reformat to enable black 24.3.0 --- blinkapp/blinkapp.py | 1 + blinkpy/auth.py | 1 + blinkpy/camera.py | 1 + blinkpy/sync_module.py | 1 + requirements_test.txt | 2 +- tests/mock_responses.py | 1 + tests/test_blink_functions.py | 1 + tests/test_blinkpy.py | 21 ++++++++++++--------- tests/test_doorbell_as_sync.py | 1 + tests/test_errors.py | 1 + tests/test_mini_as_sync.py | 1 + tests/test_sync_module.py | 3 ++- 12 files changed, 24 insertions(+), 11 deletions(-) diff --git a/blinkapp/blinkapp.py b/blinkapp/blinkapp.py index f0bd65df..840ff58d 100644 --- a/blinkapp/blinkapp.py +++ b/blinkapp/blinkapp.py @@ -1,4 +1,5 @@ """Script to run blinkpy as an blinkapp.""" + from os import environ import asyncio from datetime import datetime, timedelta diff --git a/blinkpy/auth.py b/blinkpy/auth.py index 250a081a..78db9d9a 100644 --- a/blinkpy/auth.py +++ b/blinkpy/auth.py @@ -1,4 +1,5 @@ """Login handler for blink.""" + import logging from aiohttp import ( ClientSession, diff --git a/blinkpy/camera.py b/blinkpy/camera.py index 95e8c35a..39a134fb 100644 --- a/blinkpy/camera.py +++ b/blinkpy/camera.py @@ -1,4 +1,5 @@ """Defines Blink cameras.""" + import copy import string import os diff --git a/blinkpy/sync_module.py b/blinkpy/sync_module.py index 8ebbaaa2..63b6aef6 100644 --- a/blinkpy/sync_module.py +++ b/blinkpy/sync_module.py @@ -1,4 +1,5 @@ """Defines a sync module for Blink.""" + import logging import string import datetime diff --git a/requirements_test.txt b/requirements_test.txt index efb3c729..a68f87f1 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,5 +1,5 @@ ruff==0.3.7 -black==23.12.1 +black==24.3.0 build==1.2.1 coverage==7.4.0 pytest==8.1.1 diff --git a/tests/mock_responses.py b/tests/mock_responses.py index 43a6d608..96c953bb 100644 --- a/tests/mock_responses.py +++ b/tests/mock_responses.py @@ -1,4 +1,5 @@ """Simple mock responses definitions.""" + from unittest import mock diff --git a/tests/test_blink_functions.py b/tests/test_blink_functions.py index afd62a2f..eedebfd3 100644 --- a/tests/test_blink_functions.py +++ b/tests/test_blink_functions.py @@ -1,4 +1,5 @@ """Tests camera and system functions.""" + from unittest import mock, IsolatedAsyncioTestCase import time import random diff --git a/tests/test_blinkpy.py b/tests/test_blinkpy.py index 6745d6c6..9c01eb04 100644 --- a/tests/test_blinkpy.py +++ b/tests/test_blinkpy.py @@ -69,9 +69,12 @@ async def test_throttle(self, mock_time): self.assertEqual(self.blink.last_refresh, None) self.assertEqual(self.blink.check_if_ok_to_update(), True) self.assertEqual(self.blink.last_refresh, None) - with mock.patch( - "blinkpy.sync_module.BlinkSyncModule.refresh", return_value=True - ), mock.patch("blinkpy.blinkpy.Blink.get_homescreen", return_value=True): + with ( + mock.patch( + "blinkpy.sync_module.BlinkSyncModule.refresh", return_value=True + ), + mock.patch("blinkpy.blinkpy.Blink.get_homescreen", return_value=True), + ): await self.blink.refresh(force=True) self.assertEqual(self.blink.last_refresh, now) @@ -81,12 +84,12 @@ async def test_throttle(self, mock_time): async def test_not_available_refresh(self): """Check that setup_post_verify executes on refresh when not avialable.""" self.blink.available = False - with mock.patch( - "blinkpy.sync_module.BlinkSyncModule.refresh", return_value=True - ), mock.patch( - "blinkpy.blinkpy.Blink.get_homescreen", return_value=True - ), mock.patch( - "blinkpy.blinkpy.Blink.setup_post_verify", return_value=True + with ( + mock.patch( + "blinkpy.sync_module.BlinkSyncModule.refresh", return_value=True + ), + mock.patch("blinkpy.blinkpy.Blink.get_homescreen", return_value=True), + mock.patch("blinkpy.blinkpy.Blink.setup_post_verify", return_value=True), ): self.assertTrue(await self.blink.refresh(force=True)) with mock.patch("time.time", return_value=time.time() + 4): diff --git a/tests/test_doorbell_as_sync.py b/tests/test_doorbell_as_sync.py index 154c0727..d4ecd6a6 100644 --- a/tests/test_doorbell_as_sync.py +++ b/tests/test_doorbell_as_sync.py @@ -1,4 +1,5 @@ """Tests camera and system functions.""" + from unittest import mock from unittest import IsolatedAsyncioTestCase import pytest diff --git a/tests/test_errors.py b/tests/test_errors.py index 356b0a4e..83985b91 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -1,4 +1,5 @@ """Test blink Utils errors.""" + import unittest from blinkpy.helpers.errors import ( USERNAME, diff --git a/tests/test_mini_as_sync.py b/tests/test_mini_as_sync.py index 5c6f3e68..538f6648 100644 --- a/tests/test_mini_as_sync.py +++ b/tests/test_mini_as_sync.py @@ -1,4 +1,5 @@ """Tests camera and system functions.""" + from unittest import mock from unittest import IsolatedAsyncioTestCase import pytest diff --git a/tests/test_sync_module.py b/tests/test_sync_module.py index 0e41b12c..a1c81cbf 100644 --- a/tests/test_sync_module.py +++ b/tests/test_sync_module.py @@ -1,4 +1,5 @@ """Tests camera and system functions.""" + import datetime import logging from unittest import IsolatedAsyncioTestCase @@ -31,7 +32,7 @@ def setUp(self): self.blink: Blink = Blink(motion_interval=0, session=mock.AsyncMock()) self.blink.last_refresh = 0 self.blink.urls = BlinkURLHandler("test") - self.blink.sync["test"]: (BlinkSyncModule) = BlinkSyncModule( + self.blink.sync["test"]: BlinkSyncModule = BlinkSyncModule( self.blink, "test", "1234", [] ) self.blink.sync["test"].network_info = {"network": {"armed": True}}