Skip to content

Commit

Permalink
Fix unit tests relying on double config conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly committed Aug 5, 2024
1 parent dbfc27b commit 86fdcd6
Showing 1 changed file with 8 additions and 12 deletions.
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)

Check failure on line 432 in tests/test_application.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.8.14

test_delayed_scan KeyError: 'ota'

Check failure on line 432 in tests/test_application.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.9.15

test_delayed_scan KeyError: 'ota'

Check failure on line 432 in tests/test_application.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.10.8

test_delayed_scan KeyError: 'ota'

Check failure on line 432 in tests/test_application.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.11.0

test_delayed_scan KeyError: 'ota'

Check failure on line 432 in tests/test_application.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.12

test_delayed_scan KeyError: 'ota'
with patch.object(app, "get_device", return_value=coord):
Expand Down

0 comments on commit 86fdcd6

Please sign in to comment.