From ef3d24e8c84dac705a4d1f0bacdc64fec7bffe22 Mon Sep 17 00:00:00 2001 From: Zohar Lorberbaum Date: Sun, 27 Mar 2016 21:42:52 -0700 Subject: locust_task re-use locust_code. --- test/mitmproxy/test_flow_export.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'test') 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 -- cgit v1.2.3 922bf15994'>root/xen/include/asm-x86/current.h
blob: 0a423fba67f1186765d59f452ba510989f04397b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64