Skip to content

Commit 987380b

Browse files
fix pre-commit errors
1 parent e77ae92 commit 987380b

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

.github/workflows/ci_cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI/CD
22
on:
33
pull_request:
44
push:
5-
5+
66
env:
77
MAIN_PYTHON_VERSION: '3.12'
88

tests/test_list_functions.py

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,53 @@
1-
import pytest
2-
from fastapi.testclient import TestClient
31
from app.app import app
2+
from fastapi.testclient import TestClient
3+
import pytest
44

55
# Initialize the test client
66
client = TestClient(app)
77

8+
89
@pytest.mark.asyncio
910
async def test_list_functions():
1011
"""Test listing available functions."""
1112
# Test splitter results
1213
response = client.get("/", headers={"api-key": "test_api_key"})
1314
assert response.status_code == 200
1415
response_data = response.json()
15-
16+
1617
expected_response_start = [
1718
{
1819
"name": "split_ppt",
1920
"path": "/splitter/ppt",
2021
"inputs": [
2122
{"name": "document_content", "type": "string(binary)"},
2223
{"name": "chunk_size", "type": "integer"},
23-
{"name": "chunk_overlap", "type": "integer"}
24+
{"name": "chunk_overlap", "type": "integer"},
2425
],
25-
"outputs": [
26-
{"name": "chunks", "type": "array<string>"}
27-
],
28-
"definitions": {}
26+
"outputs": [{"name": "chunks", "type": "array<string>"}],
27+
"definitions": {},
2928
},
3029
{
3130
"name": "split_py",
3231
"path": "/splitter/py",
3332
"inputs": [
3433
{"name": "document_content", "type": "string(binary)"},
3534
{"name": "chunk_size", "type": "integer"},
36-
{"name": "chunk_overlap", "type": "integer"}
37-
],
38-
"outputs": [
39-
{"name": "chunks", "type": "array<string>"}
35+
{"name": "chunk_overlap", "type": "integer"},
4036
],
41-
"definitions": {}
37+
"outputs": [{"name": "chunks", "type": "array<string>"}],
38+
"definitions": {},
4239
},
4340
{
4441
"name": "split_pdf",
4542
"path": "/splitter/pdf",
4643
"inputs": [
4744
{"name": "document_content", "type": "string(binary)"},
4845
{"name": "chunk_size", "type": "integer"},
49-
{"name": "chunk_overlap", "type": "integer"}
50-
],
51-
"outputs": [
52-
{"name": "chunks", "type": "array<string>"}
46+
{"name": "chunk_overlap", "type": "integer"},
5347
],
54-
"definitions": {}
55-
}
48+
"outputs": [{"name": "chunks", "type": "array<string>"}],
49+
"definitions": {},
50+
},
5651
]
5752

5853
assert response_data[:3] == expected_response_start
@@ -61,4 +56,3 @@ async def test_list_functions():
6156
response = client.get("/", headers={"api-key": "invalid_api_key"})
6257
assert response.status_code == 401
6358
assert response.json() == {"detail": "Invalid API key"}
64-

0 commit comments

Comments
 (0)