def test_associate_line_to_device(self, line_dao_edit, link_device_config, rebuild_device_config): device = Device(id=self.device_id) line = LineSIP() device_services.associate_line_to_device(device, line) line_dao_edit.assert_called_once_with(line) link_device_config.assert_called_once_with(device) rebuild_device_config.assert_called_once_with(device) self.assertEquals(line.device_id, self.device_id)
def associate_line(deviceid, lineid): device = device_services.get(deviceid) line = line_services.get(lineid) device_services.associate_line_to_device(device, line) return make_response('', 204)