Skip to content

Commit

Permalink
Fix ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
robbinjanssen authored and renovate[bot] committed Mar 11, 2024
1 parent 7f75a91 commit e76c1be
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/omnikinverter/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants for the Omnik Inverter."""

import logging

LOGGER = logging.getLogger(__package__)
1 change: 1 addition & 0 deletions src/omnikinverter/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Models for Omnik Inverter."""

from __future__ import annotations

import re
Expand Down
1 change: 1 addition & 0 deletions src/omnikinverter/omnikinverter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Asynchronous Python client for the Omnik Inverter."""

from __future__ import annotations

import asyncio
Expand Down
1 change: 1 addition & 0 deletions src/omnikinverter/tcp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Data model and conversions for tcp-based communication with the Omnik Inverter."""

from __future__ import annotations

from ctypes import BigEndianStructure, c_char, c_ubyte, c_uint, c_ushort, sizeof
Expand Down
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Testing functionality for the Omnik Inverter device."""

from pathlib import Path


Expand Down
14 changes: 9 additions & 5 deletions tests/test_omnik.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Basic tests for the Omnik Inverter device."""

import asyncio
from unittest.mock import patch

Expand Down Expand Up @@ -207,11 +208,14 @@ async def test_client_error() -> None:
"""Test request client error from Omnik Inverter."""
async with ClientSession() as session:
client = OmnikInverter(host="example.com", session=session)
with patch.object(
session,
"request",
side_effect=ClientError,
), pytest.raises(OmnikInverterConnectionError):
with (
patch.object(
session,
"request",
side_effect=ClientError,
),
pytest.raises(OmnikInverterConnectionError),
):
assert await client.request("test")


Expand Down

0 comments on commit e76c1be

Please sign in to comment.