async def test_conbee_dev_remove_from_group(app, nwk): group = mock.MagicMock() app.groups[mock.sentinel.grp_id] = group conbee = application.ConBeeDevice(app, mock.sentinel.ieee, nwk) conbee.endpoints = { 0: mock.sentinel.zdo, 1: mock.sentinel.ep1, 2: mock.sentinel.ep2, } await conbee.remove_from_group(mock.sentinel.grp_id) assert group.remove_member.call_count == 2
async def test_conbee_dev_add_to_group(app, nwk): group = mock.MagicMock() app._groups = mock.MagicMock() app._groups.add_group.return_value = group conbee = application.ConBeeDevice(app, mock.sentinel.ieee, nwk) conbee.endpoints = { 0: mock.sentinel.zdo, 1: mock.sentinel.ep1, 2: mock.sentinel.ep2, } await conbee.add_to_group(mock.sentinel.grp_id, mock.sentinel.grp_name) assert group.add_member.call_count == 2 assert app.groups.add_group.call_count == 1 assert app.groups.add_group.call_args[0][0] is mock.sentinel.grp_id assert app.groups.add_group.call_args[0][1] is mock.sentinel.grp_name
def test_conbee_props(nwk): conbee = application.ConBeeDevice(app, mock.sentinel.ieee, nwk) assert conbee.manufacturer is not None assert conbee.model is not None