Skip to content

Commit 2e3a05f

Browse files
author
leoguillaume
committed
fix: swagger typo and add integ test for swagger
1 parent c5e3df0 commit 2e3a05f

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

app/schemas/documents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Chunker(str, Enum):
2121
IsSeparatorRegexForm: bool = Form(default=False, description="Whether the separator is a regex to use for the file upload.") # fmt: off
2222
SeparatorsForm: List[str] = Form(default=["\n\n", "\n", ". ", " "], description="The separators to use for the file upload.") # fmt: off
2323
ChunkMinSizeForm: int = Form(default=0, description="The minimum size of the chunks to use for the file upload.") # fmt: off
24-
MetadataForm: str = Form(default="{}", description="Additional metadata to chunks, JSON string.", pattern=r"^\{.*\}$", examples='{"string_metadata": "test", "int_metadata": 1, "float_metadata": 1.0, "bool_metadata": true}') # fmt: off
24+
MetadataForm: str = Form(default="{}", description="Additional metadata to chunks, JSON string.", pattern=r"^\{.*\}$", examples=['{"string_metadata": "test", "int_metadata": 1, "float_metadata": 1.0, "bool_metadata": true}']) # fmt: off
2525
LanguageSeparatorsForm: Optional[Language] = Form(default=None, description="If provided, override separators by the code language specific separators.") # fmt: off
2626

2727

app/tests/integ/test_swagger.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from fastapi.testclient import TestClient
2+
import pytest
3+
4+
from app.utils.settings import settings
5+
6+
7+
@pytest.mark.usefixtures("client")
8+
class TestSwagger:
9+
def test_swagger(self, client: TestClient):
10+
"""Test the GET /swagger response status code."""
11+
response = client.get_without_permissions(url=settings.general.docs_url)
12+
assert response.status_code == 200, response.text
13+
14+
response = client.get_without_permissions(url=settings.general.openapi_url)
15+
assert response.status_code == 200, response.text

0 commit comments

Comments
 (0)