Skip to content
Merged
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
7 changes: 6 additions & 1 deletion tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ async def mock_coro(*args, **kwargs):
return mock.Mock(wraps=mock_coro)


def _test_startup(app, nwk_type, ieee, auto_form=False, init=0):
def _test_startup(app, nwk_type, ieee, auto_form=False, init=0, ezsp_version=4):
async def mockezsp(*args, **kwargs):
return [0, nwk_type]

async def mockinit(*args, **kwargs):
return [init]

app._in_flight_msg = None
type(app._ezsp).ezsp_version = mock.PropertyMock(return_value=ezsp_version)
app._ezsp._command = mockezsp
app._ezsp.addEndpoint = mockezsp
app._ezsp.setConfigurationValue = mockezsp
Expand All @@ -78,6 +79,10 @@ def test_startup(app, ieee):
return _test_startup(app, t.EmberNodeType.COORDINATOR, ieee)


def test_startup_ezsp_ver7(app, ieee):
return _test_startup(app, t.EmberNodeType.COORDINATOR, ieee, ezsp_version=7)


def test_startup_no_status(app, ieee):
with pytest.raises(Exception):
return _test_startup(app, None, ieee, init=1)
Expand Down