aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mitmproxy/flow_export.py16
-rw-r--r--test/mitmproxy/test_flow_export.py24
2 files changed, 20 insertions, 20 deletions
diff --git a/mitmproxy/flow_export.py b/mitmproxy/flow_export.py
index f91a59a1..a9fd5cde 100644
--- a/mitmproxy/flow_export.py
+++ b/mitmproxy/flow_export.py
@@ -119,8 +119,8 @@ def locust_code(flow):
class WebsiteUser(HttpLocust):
task_set = UserBehavior
- min_wait=1000
- max_wait=3000
+ min_wait = 1000
+ max_wait = 3000
""").strip()
@@ -155,9 +155,9 @@ def locust_code(flow):
)
host = flow.request.scheme + "://" + flow.request.host
- code = code.replace(host, "' + self.locust.host +'")
- code = code.replace(quote_plus(host), "' + quote_plus(self.locust.host) +'")
- code = code.replace(quote(host), "' + quote(self.locust.host) +'")
+ code = code.replace(host, "' + self.locust.host + '")
+ code = code.replace(quote_plus(host), "' + quote_plus(self.locust.host) + '")
+ code = code.replace(quote(host), "' + quote(self.locust.host) + '")
return code
@@ -208,9 +208,9 @@ def locust_task(flow):
)
host = flow.request.scheme + "://" + flow.request.host
- code = code.replace(host, "' + self.locust.host +'")
- code = code.replace(quote_plus(host), "' + quote_plus(self.locust.host) +'")
- code = code.replace(quote(host), "' + quote(self.locust.host) +'")
+ code = code.replace(host, "' + self.locust.host + '")
+ code = code.replace(quote_plus(host), "' + quote_plus(self.locust.host) + '")
+ code = code.replace(quote(host), "' + quote(self.locust.host) + '")
code = "\n".join(" " + i for i in code.splitlines())
diff --git a/test/mitmproxy/test_flow_export.py b/test/mitmproxy/test_flow_export.py
index 6654d990..6c9a6756 100644
--- a/test/mitmproxy/test_flow_export.py
+++ b/test/mitmproxy/test_flow_export.py
@@ -192,7 +192,7 @@ class UserBehavior(TaskSet):
@task()
def flow(self):
- url = '' + self.locust.host +'/path'
+ url = '' + self.locust.host + '/path'
headers = {
'header': 'qvalue',
@@ -210,8 +210,8 @@ class UserBehavior(TaskSet):
class WebsiteUser(HttpLocust):
task_set = UserBehavior
- min_wait=1000
- max_wait=3000
+ min_wait = 1000
+ max_wait = 3000
""".strip()
assert flow_export.locust_code(flow) == result
@@ -230,7 +230,7 @@ class UserBehavior(TaskSet):
@task()
def flow(self):
- url = '' + self.locust.host +'/path'
+ url = '' + self.locust.host + '/path'
data = '''content'''
@@ -245,8 +245,8 @@ class UserBehavior(TaskSet):
class WebsiteUser(HttpLocust):
task_set = UserBehavior
- min_wait=1000
- max_wait=3000
+ min_wait = 1000
+ max_wait = 3000
""".strip()
@@ -265,7 +265,7 @@ class UserBehavior(TaskSet):
@task()
def flow(self):
- url = '' + self.locust.host +'/path'
+ url = '' + self.locust.host + '/path'
headers = {
'header': 'qvalue',
@@ -291,8 +291,8 @@ class UserBehavior(TaskSet):
class WebsiteUser(HttpLocust):
task_set = UserBehavior
- min_wait=1000
- max_wait=3000
+ min_wait = 1000
+ max_wait = 3000
""".strip()
@@ -306,7 +306,7 @@ class TestExportLocustTask():
result = ' ' + """
@task()
def path(self):
- url = '' + self.locust.host +'/path'
+ url = '' + self.locust.host + '/path'
headers = {
'header': 'qvalue',
@@ -327,7 +327,7 @@ class TestExportLocustTask():
result = ' ' + """
@task()
def path(self):
- url = '' + self.locust.host +'/path'
+ url = '' + self.locust.host + '/path'
data = '''content'''
@@ -347,7 +347,7 @@ class TestExportLocustTask():
result = ' ' + """
@task()
def path(self):
- url = '' + self.locust.host +'/path'
+ url = '' + self.locust.host + '/path'
headers = {
'header': 'qvalue',