Skip to content

Commit

Permalink
Update test_loop.py
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinjosechittilappilly authored and ogabrielluiz committed Jan 10, 2025
1 parent 694fbab commit a161193
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/backend/tests/unit/components/logic/test_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,15 @@ async def test_build_flow_loop(client, json_loop_test, logged_in_headers):
async def test_run_flow_loop(client: AsyncClient, created_api_key, json_loop_test, logged_in_headers):
flow_id = await _create_flow(client, json_loop_test, logged_in_headers)
headers = {"x-api-key": created_api_key.api_key}
payload = {"input_value": TEXT, "input_type": "chat", "output_type": "chat", "tweaks": {}}
payload = {
"input_value": TEXT,
"input_type": "chat",
"session_id": f"{flow_id}run",
"output_type": "chat",
"tweaks": {},
}
response = await client.post(f"/api/v1/run/{flow_id}", json=payload, headers=headers)
data = response.json()
assert "outputs" in data
assert "session_id" in data
assert len(data["outputs"]) > 0
assert len(data["outputs"][-1]["outputs"]) > 0

0 comments on commit a161193

Please sign in to comment.