merge dev into two_edges
This commit is contained in:
commit
fcf4512210
133 changed files with 2534 additions and 1507 deletions
|
|
@ -707,36 +707,36 @@ def test_run_flow_with_caching_invalid_input_format(client: TestClient, starter_
|
|||
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
|
||||
|
||||
|
||||
@pytest.mark.api_key_required
|
||||
def test_run_flow_with_session_id(client, starter_project, created_api_key):
|
||||
headers = {"x-api-key": created_api_key.api_key}
|
||||
flow_id = starter_project["id"]
|
||||
payload = {
|
||||
"input_value": "value1",
|
||||
"input_type": "text",
|
||||
"output_type": "text",
|
||||
"session_id": "test-session-id",
|
||||
}
|
||||
response = client.post(f"/api/v1/run/{flow_id}", json=payload, headers=headers)
|
||||
assert response.status_code == status.HTTP_404_NOT_FOUND
|
||||
data = response.json()
|
||||
assert {"detail": "Session test-session-id not found"} == data
|
||||
# @pytest.mark.api_key_required
|
||||
# def test_run_flow_with_session_id(client, starter_project, created_api_key):
|
||||
# headers = {"x-api-key": created_api_key.api_key}
|
||||
# flow_id = starter_project["id"]
|
||||
# payload = {
|
||||
# "input_value": "value1",
|
||||
# "input_type": "text",
|
||||
# "output_type": "text",
|
||||
# "session_id": "test-session-id",
|
||||
# }
|
||||
# response = client.post(f"/api/v1/run/{flow_id}", json=payload, headers=headers)
|
||||
# assert response.status_code == status.HTTP_404_NOT_FOUND
|
||||
# data = response.json()
|
||||
# assert {"detail": "Session test-session-id not found"} == data
|
||||
|
||||
|
||||
def test_run_flow_with_invalid_session_id(client, starter_project, created_api_key):
|
||||
headers = {"x-api-key": created_api_key.api_key}
|
||||
flow_id = starter_project["id"]
|
||||
payload = {
|
||||
"input_value": "value1",
|
||||
"input_type": "text",
|
||||
"output_type": "text",
|
||||
"session_id": "invalid-session-id",
|
||||
}
|
||||
response = client.post(f"/api/v1/run/{flow_id}", json=payload, headers=headers)
|
||||
assert response.status_code == status.HTTP_404_NOT_FOUND
|
||||
data = response.json()
|
||||
assert "detail" in data
|
||||
assert f"Session {payload['session_id']} not found" in data["detail"]
|
||||
# def test_run_flow_with_invalid_session_id(client, starter_project, created_api_key):
|
||||
# headers = {"x-api-key": created_api_key.api_key}
|
||||
# flow_id = starter_project["id"]
|
||||
# payload = {
|
||||
# "input_value": "value1",
|
||||
# "input_type": "text",
|
||||
# "output_type": "text",
|
||||
# "session_id": "invalid-session-id",
|
||||
# }
|
||||
# response = client.post(f"/api/v1/run/{flow_id}", json=payload, headers=headers)
|
||||
# assert response.status_code == status.HTTP_404_NOT_FOUND
|
||||
# data = response.json()
|
||||
# assert "detail" in data
|
||||
# assert f"Session {payload['session_id']} not found" in data["detail"]
|
||||
|
||||
|
||||
@pytest.mark.api_key_required
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue