考虑课程:
class UserBehavior(TaskSet):
@task(1)
def task_one(self):
# call server
# now there is response from the server
@task(1)
def task_two(self):
# call server but request should use response data from task_one()
据我了解,如果需要将数据从TaskSequence
传输到task_one()
,应该使用task_two()
类?但是我找不到有关如何将数据从一个任务转移到另一个任务的文档。正确吗?
class UserBehavior(TaskSequence):
@seq_task(1)
def task_one(self):
...
self.resp = ... # save response here for task_two()
@seq_task(2)
def task_two(self):
...
# use here self.resp from task_one()
?