import os from locust import HttpUser, task JWT_TOKEN = os.environ.get('JWT_TOKEN') class HelloWorldUser(HttpUser): @task def hello_world(self): self.client.get("/hello/") class PostingUser(HttpUser): @task def post_method_ftw(self): self.client.post( "/identity/self/check/resources/", headers={ "Authorization": f"Bearer {JWT_TOKEN}", }, json={ "resources": [ { "resource": { "resource_id": "123", "resource_type": "campaign", "attributes": { "tenant": { "tenant_uuid": "c87b9586-03dc-47be-a3b0-53ca84aa4145", "tenant_type": "account" } } }, "action": "view" } ] } )