aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorZohar Lorberbaum <Zohar.Lorberbaum@qumu.com>2016-03-27 21:42:52 -0700
committerZohar Lorberbaum <Zohar.Lorberbaum@qumu.com>2016-03-27 21:42:52 -0700
commitef3d24e8c84dac705a4d1f0bacdc64fec7bffe22 (patch)
tree58eed742d0194d344e368881a21423667adb2f2d /test
parent9f77c80a327e7c409f0971b9d83ff3a67c2da231 (diff)
downloadmitmproxy-ef3d24e8c84dac705a4d1f0bacdc64fec7bffe22.tar.gz
mitmproxy-ef3d24e8c84dac705a4d1f0bacdc64fec7bffe22.tar.bz2
mitmproxy-ef3d24e8c84dac705a4d1f0bacdc64fec7bffe22.zip
locust_task re-use locust_code.
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_flow_export.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/test/mitmproxy/test_flow_export.py b/test/mitmproxy/test_flow_export.py
index 6c9a6756..d937135f 100644
--- a/test/mitmproxy/test_flow_export.py
+++ b/test/mitmproxy/test_flow_export.py
@@ -188,10 +188,10 @@ from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
def on_start(self):
''' on_start is called when a Locust start before any task is scheduled '''
- self.flow()
+ self.path()
@task()
- def flow(self):
+ def path(self):
url = '' + self.locust.host + '/path'
headers = {
@@ -226,10 +226,10 @@ from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
def on_start(self):
''' on_start is called when a Locust start before any task is scheduled '''
- self.flow()
+ self.path()
@task()
- def flow(self):
+ def path(self):
url = '' + self.locust.host + '/path'
data = '''content'''
@@ -261,10 +261,10 @@ from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
def on_start(self):
''' on_start is called when a Locust start before any task is scheduled '''
- self.flow()
+ self.path()
@task()
- def flow(self):
+ def path(self):
url = '' + self.locust.host + '/path'
headers = {
@@ -312,13 +312,13 @@ class TestExportLocustTask():
'header': 'qvalue',
'content-length': '7',
}
-
+
self.response = self.client.request(
method='GET',
url=url,
headers=headers,
)
- """.strip()
+ """.strip() + '\n'
assert flow_export.locust_task(flow) == result
@@ -330,14 +330,13 @@ class TestExportLocustTask():
url = '' + self.locust.host + '/path'
data = '''content'''
-
+
self.response = self.client.request(
method='POST',
url=url,
data=data,
)
-
- """.strip()
+ """.strip() + '\n'
assert flow_export.locust_task(flow) == result
@@ -353,13 +352,13 @@ class TestExportLocustTask():
'header': 'qvalue',
'content-length': '7',
}
-
+
params = {
'query': 'param',
}
-
+
data = '''content'''
-
+
self.response = self.client.request(
method='PATCH',
url=url,
@@ -367,6 +366,6 @@ class TestExportLocustTask():
params=params,
data=data,
)
- """.strip()
+ """.strip() + '\n'
assert flow_export.locust_task(flow) == result