

def test_verify_networks_error_and_notice_are_concatenated(self):
    cluster_db = self.env.create(cluster_kwargs={
        
    }, nodes_kwargs=[{
        'api': False,
    }, {
        'api': False,
    }])
    (node1, node2) = self.env.nodes
    nets = [{
        'iface': 'eth0',
        'vlans': range(100, 105),
    }]
    task = Task(name='verify_networks', cluster_id=cluster_db.id)
    task.cache = {
        'args': {
            'nodes': self.nodes_message((node1, node2), nets),
            'offline': 2,
        },
    }
    self.db.add(task)
    self.db.flush()
    custom_error = 'CustomError'
    kwargs = {
        'task_uuid': task.uuid,
        'status': 'error',
        'nodes': self.nodes_message((node1, node2), nets),
        'error': custom_error,
    }
    self.receiver.verify_networks_resp(**kwargs)
    self.db.flush()
    self.db.refresh(task)
    self.assertEqual(task.status, 'error')
    offline_notice = 'Notice: 2 node(s) were offline during connectivity check so they were skipped from the check.'
    self.assertEqual(task.message, '\n'.join((custom_error, offline_notice)))

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/integration/test_rpc_consumer.py TestVerifyNetworks.test_verify_networks_error_and_notice_are_concatenated/original