Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:
with:
CODE_FOLDER: zigpy_xbee
CACHE_VERSION: 2
PYTHON_VERSION_DEFAULT: 3.9.15
PRE_COMMIT_CACHE_PATH: ~/.cache/pre-commit
MINIMUM_COVERAGE_PERCENTAGE: 100
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
14 changes: 7 additions & 7 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def _handle_at_response(api, tsn, status, at_response=b""):
return response


def test_handle_at_response_none(api):
async def test_handle_at_response_none(api):
"""Test AT successful response with no value."""
tsn = 123
fut = _handle_at_response(api, tsn, 0)
Expand All @@ -332,7 +332,7 @@ def test_handle_at_response_none(api):
assert fut.exception() is None


def test_handle_at_response_data(api):
async def test_handle_at_response_data(api):
"""Test AT successful response with data."""
tsn = 123
status, response = 0, 0x23
Expand All @@ -342,7 +342,7 @@ def test_handle_at_response_data(api):
assert fut.exception() is None


def test_handle_at_response_error(api):
async def test_handle_at_response_error(api):
"""Test AT unsuccessful response."""
tsn = 123
status, response = 1, 0x23
Expand All @@ -351,7 +351,7 @@ def test_handle_at_response_error(api):
assert isinstance(fut.exception(), ATCommandError)


def test_handle_at_response_invalid_command(api):
async def test_handle_at_response_invalid_command(api):
"""Test invalid AT command response."""
tsn = 123
status, response = 2, 0x23
Expand All @@ -360,7 +360,7 @@ def test_handle_at_response_invalid_command(api):
assert isinstance(fut.exception(), InvalidCommand)


def test_handle_at_response_undef_error(api):
async def test_handle_at_response_undef_error(api):
"""Test AT unsuccessful response with undefined error."""
tsn = 123
status, response = 0xEE, 0x23
Expand Down Expand Up @@ -482,7 +482,7 @@ def test_handle_tx_status_duplicate(api):
assert send_fut.set_exception.call_count == 0


def test_handle_registration_status(api):
async def test_handle_registration_status(api):
"""Test device registration status."""
frame_id = 0x12
status = xbee_t.RegistrationStatus.SUCCESS
Expand Down Expand Up @@ -526,7 +526,7 @@ async def test_command_mode_at_cmd_timeout(api):
assert result is None


def test_handle_command_mode_rsp(api):
async def test_handle_command_mode_rsp(api):
"""Test command mode response."""
api._cmd_mode_future = None
data = "OK"
Expand Down
6 changes: 3 additions & 3 deletions tests/test_uart.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from unittest import mock

import pytest
import serial_asyncio
import serial_asyncio_fast
import zigpy.config

from zigpy_xbee import uart
Expand All @@ -22,7 +22,7 @@ def gw():
"""Gateway fixture."""
gw = uart.Gateway(mock.MagicMock())
gw._transport = mock.MagicMock()
gw._transport.serial.BAUDRATES = serial_asyncio.serial.Serial.BAUDRATES
gw._transport.serial.BAUDRATES = serial_asyncio_fast.serial.Serial.BAUDRATES
return gw


Expand All @@ -48,7 +48,7 @@ async def mock_conn(loop, protocol_factory, **kwargs):
loop.call_soon(protocol.connection_made, None)
return None, protocol

monkeypatch.setattr(serial_asyncio, "create_serial_connection", mock_conn)
monkeypatch.setattr(serial_asyncio_fast, "create_serial_connection", mock_conn)

await uart.connect(DEVICE_CONFIG, api)

Expand Down
Loading