summaryrefslogtreecommitdiff
path: root/benchmarks/py-locust/files/extra-EXAMPLES-dynamice_user_credentials.py
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/py-locust/files/extra-EXAMPLES-dynamice_user_credentials.py')
-rw-r--r--benchmarks/py-locust/files/extra-EXAMPLES-dynamice_user_credentials.py25
1 files changed, 0 insertions, 25 deletions
diff --git a/benchmarks/py-locust/files/extra-EXAMPLES-dynamice_user_credentials.py b/benchmarks/py-locust/files/extra-EXAMPLES-dynamice_user_credentials.py
deleted file mode 100644
index 6f8f66baa5ca..000000000000
--- a/benchmarks/py-locust/files/extra-EXAMPLES-dynamice_user_credentials.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# locustfile.py
-
-from locust import HttpLocust, TaskSet, task
-
-USER_CREDENTIALS = [
- ("user1", "password"),
- ("user2", "password"),
- ("user3", "password"),
-]
-
-class UserBehaviour(TaskSet):
- def on_start(self):
- if len(USER_CREDENTIALS) > 0:
- user, passw = USER_CREDENTIALS.pop()
- self.client.post("/login", {"username":user, "password":passw})
-
- @task
- def some_task(self):
- # user should be logged in here (unless the USER_CREDENTIALS ran out)
- self.client.get("/protected/resource")
-
-class User(HttpLocust):
- task_set = UserBehaviour
- min_wait = 5000
- max_wait = 60000