Skip to content

Commit

Permalink
Fix unit tests relying on double config conversion (#261)
Browse files Browse the repository at this point in the history
* Fix unit tests relying on double config conversion

* Bump minimum zigpy version
  • Loading branch information
puddly authored Aug 13, 2024
1 parent 4722403 commit f909042
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ license = {text = "GPL-3.0"}
requires-python = ">=3.8"
dependencies = [
"voluptuous",
"zigpy>=0.60.2",
"zigpy>=0.65.3",
'async-timeout; python_version<"3.11"',
]

Expand Down
20 changes: 8 additions & 12 deletions tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,10 @@ def api():

@pytest.fixture
def app(device_path, api):
config = application.ControllerApplication.SCHEMA(
{
**ZIGPY_NWK_CONFIG,
zigpy.config.CONF_DEVICE: {zigpy.config.CONF_DEVICE_PATH: device_path},
}
)
config = {
**ZIGPY_NWK_CONFIG,
zigpy.config.CONF_DEVICE: {zigpy.config.CONF_DEVICE_PATH: device_path},
}

app = application.ControllerApplication(config)

Expand Down Expand Up @@ -426,12 +424,10 @@ async def test_delayed_scan():
"""Delayed scan."""

coord = MagicMock()
config = application.ControllerApplication.SCHEMA(
{
zigpy.config.CONF_DEVICE: {zigpy.config.CONF_DEVICE_PATH: "usb0"},
zigpy.config.CONF_DATABASE: "tmp",
}
)
config = {
zigpy.config.CONF_DEVICE: {zigpy.config.CONF_DEVICE_PATH: "usb0"},
zigpy.config.CONF_DATABASE: "tmp",
}

app = application.ControllerApplication(config)
with patch.object(app, "get_device", return_value=coord):
Expand Down

0 comments on commit f909042

Please sign in to comment.