diff options
author | Thais Siqueira <thais.siqueira@gmail.com> | 2016-03-22 15:25:39 -0300 |
---|---|---|
committer | Thais Siqueira <thais.siqueira@gmail.com> | 2016-03-22 15:26:41 -0300 |
commit | e376b0d3f13e57750c3802100e30e02228e22603 (patch) | |
tree | a639723080f050840dbae0b85b93f8adc9138954 /service | |
parent | f3dbf769d2c22b18871a84949ad95d10ca06e4a4 (diff) |
Adds changes to run load test on current version.
Diffstat (limited to 'service')
-rw-r--r-- | service/test/load/locustfile.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/service/test/load/locustfile.py b/service/test/load/locustfile.py index 0c2ed518..69a545ed 100644 --- a/service/test/load/locustfile.py +++ b/service/test/load/locustfile.py @@ -54,10 +54,11 @@ class UserBehavior(TaskSet): response = self.client.post( "/%s" % LoginResource.BASE_URL, {"username": username, "password": password}, - verify=False) + verify=False, + cookies=self.cookies) self.cookies.update(response.cookies.get_dict()) - resp = self.client.get("/", verify=False) - self.cookies.update(resp.cookies.get_dict()) + #resp = self.client.get("/", verify=False) + #self.cookies.update(resp.cookies.get_dict()) self.username = username @task(1) @@ -83,7 +84,6 @@ class UserBehavior(TaskSet): self.cookies.update( self.client.get("/", verify=False).cookies.get_dict()) - print(self.cookies) with self.client.post( '/mails', json=payload, @@ -91,7 +91,7 @@ class UserBehavior(TaskSet): cookies=self.cookies, headers={ 'X-Requested-With': 'XMLHttpRequest', - 'X-XSRF-TOKEN': self.cookies['XSRF-TOKEN']}) as email_response: + 'X-XSRF-TOKEN': self.cookies.get('XSRF-TOKEN', '')}) as email_response: if email_response.status_code == 201: email_id = json.loads(email_response.content)['ident'] print email_id @@ -110,10 +110,10 @@ class UserBehavior(TaskSet): verify=False, headers={ 'X-Requested-With': 'XMLHttpRequest', - 'X-XSRF-TOKEN': self.cookies['XSRF-TOKEN']}) + 'X-XSRF-TOKEN': self.cookies.get('XSRF-TOKEN', '')}) class WebsiteUser(HttpLocust): task_set = UserBehavior - min_wait = 5000 - max_wait = 15000 + min_wait = 1000 + max_wait = 5000 |