Created
October 10, 2018 15:46
-
-
Save bodharma/1f53c8a77a3545adadb5790de0c78475 to your computer and use it in GitHub Desktop.
Revisions
-
velocyno created this gist
Oct 10, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ from locust import HttpLocust, TaskSet, task import logging, sys from credentials import * class LoginWithUniqueUsersSteps(TaskSet): email = "NOT_FOUND" password = "NOT_FOUND" def on_start(self): if len(USER_CREDENTIALS) > 0: self.email, self.password = USER_CREDENTIALS.pop() @task def login(self): self.client.post("/login", { 'email': self.email, 'password': self.password }) logging.info('Login with %s email and %s password', self.email, self.password) class LoginWithUniqueUsersTest(HttpLocust): task_set = LoginWithUniqueUsersSteps host = "http://blazedemo.com" sock = None def __init__(self): super(LoginWithUniqueUsersTest, self).__init__()