🚀 chore(server, tests): update API endpoint URLs to include version number
The API endpoint URLs have been updated to include the version number to improve the API's versioning and maintainability. The changes were made to the server.ts file and the tests that use the API endpoints.
🐛 fix(tests): update API endpoint paths in test files
The API endpoint paths in the test files were outdated and have been updated to reflect the current API version. This ensures that the tests are running against the correct endpoints and that the tests are up-to-date with the current API version.
This commit is contained in:
parent
478bb446c3
commit
6b5539232f
9 changed files with 40 additions and 40 deletions
|
|
@ -5,17 +5,17 @@ from fastapi.testclient import TestClient
|
|||
|
||||
|
||||
def test_websocket_connection(client: TestClient):
|
||||
with client.websocket_connect("/chat/test_client") as websocket:
|
||||
with client.websocket_connect("api/v1/chat/test_client") as websocket:
|
||||
assert websocket.scope["client"] == ["testclient", 50000]
|
||||
assert websocket.scope["path"] == "/chat/test_client"
|
||||
assert websocket.scope["path"] == "/api/v1/chat/test_client"
|
||||
|
||||
|
||||
def test_chat_history(client: TestClient):
|
||||
# Mock the process_graph function to return a specific value
|
||||
with patch("langflow.api.chat_manager.process_graph") as mock_process_graph:
|
||||
with patch("langflow.chat.manager.process_graph") as mock_process_graph:
|
||||
mock_process_graph.return_value = ("Hello, I'm a mock response!", "")
|
||||
|
||||
with client.websocket_connect("/chat/test_client") as websocket:
|
||||
with client.websocket_connect("api/v1/chat/test_client") as websocket:
|
||||
# First message should be the history
|
||||
history = websocket.receive_json()
|
||||
assert history == [] # Empty history
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue