Skip to content

Commit

Permalink
Merge pull request #910 from mkmer/black-24.3.0-reformat
Browse files Browse the repository at this point in the history
Reformat to enable black 24.3.0
  • Loading branch information
fronzbot authored Apr 12, 2024
2 parents 560131b + aea5d77 commit 851cb03
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 11 deletions.
1 change: 1 addition & 0 deletions blinkapp/blinkapp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Script to run blinkpy as an blinkapp."""

from os import environ
import asyncio
from datetime import datetime, timedelta
Expand Down
1 change: 1 addition & 0 deletions blinkpy/auth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Login handler for blink."""

import logging
from aiohttp import (
ClientSession,
Expand Down
1 change: 1 addition & 0 deletions blinkpy/camera.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Defines Blink cameras."""

import copy
import string
import os
Expand Down
1 change: 1 addition & 0 deletions blinkpy/sync_module.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Defines a sync module for Blink."""

import logging
import string
import datetime
Expand Down
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/mock_responses.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Simple mock responses definitions."""

from unittest import mock


Expand Down
1 change: 1 addition & 0 deletions tests/test_blink_functions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests camera and system functions."""

from unittest import mock, IsolatedAsyncioTestCase
import time
import random
Expand Down
21 changes: 12 additions & 9 deletions tests/test_blinkpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand Down
1 change: 1 addition & 0 deletions tests/test_doorbell_as_sync.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests camera and system functions."""

from unittest import mock
from unittest import IsolatedAsyncioTestCase
import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test blink Utils errors."""

import unittest
from blinkpy.helpers.errors import (
USERNAME,
Expand Down
1 change: 1 addition & 0 deletions tests/test_mini_as_sync.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests camera and system functions."""

from unittest import mock
from unittest import IsolatedAsyncioTestCase
import pytest
Expand Down
3 changes: 2 additions & 1 deletion tests/test_sync_module.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests camera and system functions."""

import datetime
import logging
from unittest import IsolatedAsyncioTestCase
Expand Down Expand Up @@ -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}}
Expand Down

0 comments on commit 851cb03

Please sign in to comment.