

def test_remove_nodes_resp(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': 'ready',
        'nodes': [{
            'uid': node1.id,
        }, {
            'uid': str(node2.id),
        }],
    }
    with mock.patch('nailgun.rpc.receiver.logs_utils.delete_node_logs') as mdelete_node_logs:
        self.receiver.remove_nodes_resp(**kwargs)
    self.assertEqual(len(self.env.nodes), mdelete_node_logs.call_count)
    test_nodes = [test_nodes[0][0] for arg in mdelete_node_logs.call_args_list]
    self.assertItemsEqual(self.env.nodes, test_nodes)
    self.db.refresh(task)
    self.assertEqual(task.status, 'ready')
    nodes_db = self.db.query(Node).all()
    self.assertEqual(len(nodes_db), 0)

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/integration/test_rpc_consumer.py TestConsumer.test_remove_nodes_resp/VarMisuse@200/269 `arg`->`test_nodes`