Skip to content

Commit

Permalink
Fixing tests wip
Browse files Browse the repository at this point in the history
  • Loading branch information
tianjing-li committed Nov 6, 2024
1 parent 4d374d4 commit 242d060
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/backend/services/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ async def generate_conversation_title(
ctx=ctx,
)

import pdb
pdb.set_trace()

title = response.text
error = response.error
except Exception as e:
Expand Down
10 changes: 5 additions & 5 deletions src/backend/tests/integration/routers/test_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_create_agent(session_client: TestClient, session: Session, user) -> Non
}

response = session_client.post(
"/v1/agents", json=request_json, headers={"User-Id": user.value.ID}
"/v1/agents", json=request_json, headers={"User-Id": user.id}
)
assert response.status_code == 200
response_agent = response.json()
Expand Down Expand Up @@ -85,7 +85,7 @@ def test_create_agent_with_tool_metadata(
}

response = session_client.post(
"/v1/agents", json=request_json, headers={"User-Id": user.value.ID}
"/v1/agents", json=request_json, headers={"User-Id": user.id}
)
assert response.status_code == 200
response_agent = response.json()
Expand Down Expand Up @@ -116,7 +116,7 @@ def test_create_agent_missing_non_required_fields(
}

response = session_client.post(
"/v1/agents", json=request_json, headers={"User-Id": user.value.ID}
"/v1/agents", json=request_json, headers={"User-Id": user.id}
)
assert response.status_code == 200
response_agent = response.json()
Expand Down Expand Up @@ -159,9 +159,9 @@ def test_update_agent(session_client: TestClient, session: Session, user) -> Non
}

response = session_client.put(
f"/v1/agents/{agent.value.ID}",
f"/v1/agents/{agent.id}",
json=request_json,
headers={"User-Id": user.value.ID},
headers={"User-Id": user.id},
)

assert response.status_code == 200
Expand Down
2 changes: 2 additions & 0 deletions src/backend/tests/integration/routers/test_conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ def test_generate_title(
.filter_by(id=conversation.id, user_id=conversation.user_id)
.first()
)
import pdb
pdb.set_trace()
assert conversation is not None
assert conversation.title == response_json["title"]
assert response_json["error"] is None
Expand Down

0 comments on commit 242d060

Please sign in to comment.