Refactor code and fix minor issues

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-01-26 09:45:33 -03:00
commit dbf0a2a920
7 changed files with 20 additions and 56 deletions

View file

@ -66,9 +66,7 @@ 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,
}
@ -88,9 +86,7 @@ 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()
@ -115,11 +111,7 @@ 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