

def test_remove_nodes_resp_failure(self):
    cluster_db = self.env.create(cluster_kwargs={
        
    }, nodes_kwargs=[{
        'api': False,
    }, {
        'api': False,
    }])
    (node1, node2) = self.env.nodes
    task = Task(uuid=str(uuid.uuid4()), name='super', cluster_id=cluster_db.id)
    self.db.add(task)
    self.db.commit()
    kwargs = {
        'task_uuid': task.uuid,
        'progress': 100,
        'status': 'error',
        'nodes': [],
        'error_nodes': [{
            'uid': node1.id,
            'error': 'RPC method failed',
        }],
    }
    self.receiver.remove_nodes_resp(**kwargs)
    self.db.refresh(task)
    self.assertEqual(task.status, 'error')
    nodes_db = self.db.query(Node).all()
    error_node = self.db.query(Node).get(node1.id)
    self.db.refresh(error_node)
    self.assertEqual(len(nodes_db), 2)
    self.assertEqual(error_node.status, 'error')

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/integration/test_rpc_consumer.py TestConsumer.test_remove_nodes_resp_failure/original