|
12 | 12 | import zigpy.types as zigpy_t |
13 | 13 | import zigpy.zdo.types as zdo_t |
14 | 14 |
|
| 15 | +from bellows.ash import NcpFailure |
15 | 16 | import bellows.config as config |
16 | 17 | from bellows.exception import ControllerError, EzspError |
17 | 18 | import bellows.ezsp as ezsp |
@@ -112,7 +113,7 @@ def _create_app_for_startup( |
112 | 113 | ezsp_mock.start_ezsp() |
113 | 114 |
|
114 | 115 | ezsp_mock.connect = AsyncMock() |
115 | | - ezsp_mock.close = AsyncMock(wraps=ezsp_mock.close) |
| 116 | + ezsp_mock.disconnect = AsyncMock() |
116 | 117 | ezsp_mock.startup_reset = AsyncMock() |
117 | 118 | ezsp_mock.can_burn_userdata_custom_eui64 = AsyncMock(return_value=True) |
118 | 119 | ezsp_mock.can_rewrite_custom_eui64 = AsyncMock(return_value=True) |
@@ -1122,12 +1123,6 @@ def test_is_controller_running(app): |
1122 | 1123 | assert ezsp_running.call_count == 1 |
1123 | 1124 |
|
1124 | 1125 |
|
1125 | | -def test_reset_frame(app): |
1126 | | - app.connection_lost = MagicMock(spec_set=app.connection_lost) |
1127 | | - app.ezsp_callback_handler("_reset_controller_application", (sentinel.error,)) |
1128 | | - assert app.connection_lost.mock_calls == [call(sentinel.error)] |
1129 | | - |
1130 | | - |
1131 | 1126 | @pytest.mark.parametrize("ezsp_version", (4, 7)) |
1132 | 1127 | async def test_watchdog(make_app, monkeypatch, ezsp_version): |
1133 | 1128 | from bellows.zigbee import application |
@@ -1287,9 +1282,9 @@ async def counters_mock(): |
1287 | 1282 | async def test_shutdown(app): |
1288 | 1283 | ezsp = app._ezsp |
1289 | 1284 |
|
1290 | | - await app.shutdown() |
| 1285 | + await app.disconnect() |
1291 | 1286 | assert app.controller_event.is_set() is False |
1292 | | - assert ezsp.close.call_count == 1 |
| 1287 | + assert len(ezsp.disconnect.mock_calls) == 1 |
1293 | 1288 |
|
1294 | 1289 |
|
1295 | 1290 | @pytest.fixture |
@@ -1731,7 +1726,7 @@ async def test_connect_failure(app: ControllerApplication) -> None: |
1731 | 1726 |
|
1732 | 1727 | assert app._ezsp is None |
1733 | 1728 |
|
1734 | | - assert len(ezsp.close.mock_calls) == 1 |
| 1729 | + assert len(ezsp.disconnect.mock_calls) == 1 |
1735 | 1730 |
|
1736 | 1731 |
|
1737 | 1732 | async def test_repair_tclk_partner_ieee( |
|
0 commit comments