mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-25 14:43:37 +08:00
Refactor code formatting in locustfile.py
This commit is contained in:
@ -66,7 +66,9 @@ class NameTest(FastHttpUser):
|
||||
result1, session_id = self.process(name, self.flow_id, payload1)
|
||||
|
||||
payload2 = {
|
||||
"inputs": {"text": "What is my name? Please, answer like this: Your name is <name>"},
|
||||
"inputs": {
|
||||
"text": "What is my name? Please, answer like this: Your name is <name>"
|
||||
},
|
||||
"session_id": session_id,
|
||||
"sync": False,
|
||||
}
|
||||
@ -86,7 +88,9 @@ class NameTest(FastHttpUser):
|
||||
logged_in_headers = {"Authorization": f"Bearer {a_token}"}
|
||||
print("Logged in")
|
||||
with open(
|
||||
Path(__file__).parent.parent / "data" / "BasicChatwithPromptandHistory.json",
|
||||
Path(__file__).parent.parent
|
||||
/ "data"
|
||||
/ "BasicChatwithPromptandHistory.json",
|
||||
"r",
|
||||
) as f:
|
||||
json_flow = f.read()
|
||||
@ -111,7 +115,11 @@ class NameTest(FastHttpUser):
|
||||
)
|
||||
print(response.json())
|
||||
user_id = next(
|
||||
(user["id"] for user in response.json()["users"] if user["username"] == "superuser"),
|
||||
(
|
||||
user["id"]
|
||||
for user in response.json()["users"]
|
||||
if user["username"] == "superuser"
|
||||
),
|
||||
None,
|
||||
)
|
||||
# Create api key
|
||||
|
||||
Reference in New Issue
Block a user