

def test_remove_cluster_resp_failed(self):
    cluster_db = self.env.create(cluster_kwargs={
        
    }, nodes_kwargs=[{
        'api': False,
    }, {
        'api': False,
    }])
    (node1, node2) = self.env.nodes
    self.env.create_notification(cluster_id=cluster_db.id)
    task = Task(uuid=str(uuid.uuid4()), name='cluster_deletion', cluster_id=cluster_db.id)
    self.db.add(task)
    self.db.commit()
    kwargs = {
        'task_uuid': task.uuid,
        'progress': 100,
        'status': 'error',
        'nodes': [{
            'uid': node1.id,
        }],
        'error_nodes': [{
            'uid': node1.id,
            'error': 'RPC method failed',
        }],
    }
    self.receiver.remove_cluster_resp(**kwargs)
    self.db.refresh(task)
    self.assertEqual(task.status, 'error')
    nodes_db = self.db.query(Node).filter_by(cluster_id=cluster_db.id).all()
    self.assertNotEqual(len(nodes_db), 0)
    attrs_db = self.db.query(Attributes).filter_by(cluster_id=cluster_db.id).all()
    self.assertNotEqual(len(attrs_db), 0)
    nots_db = self.db.query(Notification).filter_by(cluster_id=cluster_db.id).all()
    self.assertNotEqual(len(nots_db), 0)
    nets_db = self.db.query(NetworkGroup).filter((NetworkGroup.group_id == objects.Cluster.get_default_group(cluster_db).id)).all()
    self.assertNotEqual(len(nets_db), 0)

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