

def test_proper_progress_calculation(self):
    supertask = Task(uuid=str(uuid.uuid4()), name='super', status='running')
    self.db.add(supertask)
    self.db.commit()
    subtask_weight = 0.4
    task_deletion = supertask.create_subtask('node_deletion', weight=subtask_weight)
    task_provision = supertask.create_subtask('provision', weight=subtask_weight)
    subtask_progress = random.randint(1, 20)
    deletion_kwargs = {
        'task_uuid': task_deletion.uuid,
        'progress': subtask_progress,
        'status': 'running',
    }
    provision_kwargs = {
        'task_uuid': task_provision.uuid,
        'progress': subtask_progress,
        'status': 'running',
    }
    self.receiver.provision_resp(**provision_kwargs)
    self.db.commit()
    self.receiver.remove_nodes_resp(**deletion_kwargs)
    self.db.commit()
    self.db.refresh(task_deletion)
    self.db.refresh(task_provision)
    self.db.refresh(supertask)
    calculated_progress = helpers.TaskHelper.calculate_parent_task_progress([task_deletion, provision_kwargs])
    self.assertEqual(supertask.progress, calculated_progress)

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/integration/test_rpc_consumer.py TestConsumer.test_proper_progress_calculation/VarMisuse@212/311 `task_provision`->`provision_kwargs`