diff --git a/tests/test_application.py b/tests/test_application.py index 2dd078d3..45aaa24e 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -123,6 +123,9 @@ def _create_app_for_startup( ezsp_mock.wait_for_stack_status.return_value.__enter__ = AsyncMock( return_value=t.EmberStatus.NETWORK_UP ) + ezsp_mock.customFrame = AsyncMock( + return_value=[t.EmberStatus.LIBRARY_NOT_PRESENT, b""] + ) ezsp_mock.xncp_get_supported_firmware_features = AsyncMock( return_value=FirmwareFeatures.NONE ) @@ -1827,6 +1830,7 @@ def zigpy_backup() -> zigpy.backups.NetworkBackup: metadata={ "ezsp": { "stack_version": 8, + "flow_control": None, "can_burn_userdata_custom_eui64": True, "can_rewrite_custom_eui64": True, } diff --git a/tests/test_ezsp.py b/tests/test_ezsp.py index cf602bc3..148833c4 100644 --- a/tests/test_ezsp.py +++ b/tests/test_ezsp.py @@ -40,6 +40,9 @@ async def mock_command(command, *args, **kwargs): api._mock_commands = {} api._mock_commands["version"] = AsyncMock(return_value=[version, 0, 0]) + api._mock_commands["customFrame"] = AsyncMock( + return_value=[t.EmberStatus.LIBRARY_NOT_PRESENT, b""] + ) api._command = AsyncMock(side_effect=mock_command) return api @@ -588,8 +591,8 @@ async def test_write_custom_eui64_rcp(ezsp_f): @patch.object(EZSP, "version", new_callable=AsyncMock) @patch.object(EZSP, "reset", new_callable=AsyncMock) -@patch.object(ezsp.EZSP, "get_xncp_features", new_callable=AsyncMock) -async def test_ezsp_init_zigbeed(reset_mock, xncp_mock, version_mock): +@patch.object(EZSP, "get_xncp_features", new_callable=AsyncMock) +async def test_ezsp_init_zigbeed(xncp_mock, reset_mock, version_mock): """Test initialize method with a received startup reset frame.""" ezsp = make_ezsp( config={ @@ -610,7 +613,7 @@ async def test_ezsp_init_zigbeed(reset_mock, xncp_mock, version_mock): @patch.object(EZSP, "version", new_callable=AsyncMock) @patch.object(EZSP, "reset", new_callable=AsyncMock) -@patch.object(ezsp.EZSP, "get_xncp_features", new_callable=AsyncMock) +@patch.object(EZSP, "get_xncp_features", new_callable=AsyncMock) @patch("bellows.ezsp.NETWORK_COORDINATOR_STARTUP_RESET_WAIT", 0.01) async def test_ezsp_init_zigbeed_timeout(reset_mock, xncp_mock, version_mock): """Test initialize method with a received startup reset frame."""