aboutsummaryrefslogtreecommitdiffstats
path: root/test/mitmproxy/test_flow_export/locust_post.py
blob: df23476a09e6da67196e0f19716b7d956196ed6f (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
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.path()

    @task()
    def path(self):
        url = self.locust.host + '/path'

        data = '''content'''

        self.response = self.client.request(
            method='POST',
            url=url,
            data=data,
        )

    ### Additional tasks can go here ###


class WebsiteUser(HttpLocust):
    task_set = UserBehavior
    min_wait = 1000
    max_wait = 3000