@@ -317,9 +317,13 @@ async def test_conbee_dev_add_to_group(app, nwk):
317317 app ._groups .add_group .return_value = group
318318
319319 conbee = application .ConBeeDevice (app , mock .sentinel .ieee , nwk )
320+ conbee .endpoints = {0 : mock .sentinel .zdo ,
321+ 1 : mock .sentinel .ep1 ,
322+ 2 : mock .sentinel .ep2
323+ }
320324
321325 await conbee .add_to_group (mock .sentinel .grp_id , mock .sentinel .grp_name )
322- assert group .add_member .call_count == 1
326+ assert group .add_member .call_count == 2
323327
324328 assert app .groups .add_group .call_count == 1
325329 assert app .groups .add_group .call_args [0 ][0 ] is mock .sentinel .grp_id
@@ -332,9 +336,13 @@ async def test_conbee_dev_remove_from_group(app, nwk):
332336 app .groups [mock .sentinel .grp_id ] = group
333337 conbee = application .ConBeeDevice (app ,
334338 mock .sentinel .ieee , nwk )
339+ conbee .endpoints = {0 : mock .sentinel .zdo ,
340+ 1 : mock .sentinel .ep1 ,
341+ 2 : mock .sentinel .ep2
342+ }
335343
336344 await conbee .remove_from_group (mock .sentinel .grp_id )
337- assert group .remove_member .call_count == 1
345+ assert group .remove_member .call_count == 2
338346
339347
340348def test_conbee_props (nwk ):
@@ -355,7 +363,11 @@ async def test_conbee_new(app, nwk, monkeypatch):
355363 assert mock_init .call_count == 1
356364 mock_init .reset_mock ()
357365
358- app .devices [mock .sentinel .ieee ] = mock .MagicMock ()
366+ mock_dev = mock .MagicMock ()
367+ mock_dev .endpoints = {0 : mock .MagicMock (),
368+ 1 : mock .MagicMock (),
369+ 22 : mock .MagicMock ()}
370+ app .devices [mock .sentinel .ieee ] = mock_dev
359371 conbee = await application .ConBeeDevice .new (app , mock .sentinel .ieee , nwk )
360372 assert isinstance (conbee , zigpy_deconz .zigbee .application .ConBeeDevice )
361373 assert mock_init .call_count == 0
0 commit comments