diff --git a/backend/app/tests/api/routes/documents/conftest.py b/backend/app/tests/api/routes/documents/conftest.py new file mode 100644 index 00000000..d36dc181 --- /dev/null +++ b/backend/app/tests/api/routes/documents/conftest.py @@ -0,0 +1,11 @@ +import pytest +from starlette.testclient import TestClient + +from app.tests.utils.auth import TestAuthContext +from app.tests.utils.document import WebCrawler + + +@pytest.fixture +def crawler(client: TestClient, user_api_key: TestAuthContext) -> WebCrawler: + """Provides a WebCrawler instance for document API testing.""" + return WebCrawler(client, user_api_key=user_api_key) diff --git a/backend/app/tests/api/routes/documents/test_route_document_info.py b/backend/app/tests/api/routes/documents/test_route_document_info.py index 5e6680b1..26198348 100644 --- a/backend/app/tests/api/routes/documents/test_route_document_info.py +++ b/backend/app/tests/api/routes/documents/test_route_document_info.py @@ -7,7 +7,6 @@ DocumentStore, Route, WebCrawler, - crawler, httpx_to_standard, ) diff --git a/backend/app/tests/api/routes/documents/test_route_document_list.py b/backend/app/tests/api/routes/documents/test_route_document_list.py index 9f4290c8..01a5e2ed 100644 --- a/backend/app/tests/api/routes/documents/test_route_document_list.py +++ b/backend/app/tests/api/routes/documents/test_route_document_list.py @@ -6,7 +6,6 @@ DocumentStore, Route, WebCrawler, - crawler, httpx_to_standard, ) diff --git a/backend/app/tests/api/routes/documents/test_route_document_permanent_remove.py b/backend/app/tests/api/routes/documents/test_route_document_permanent_remove.py index 7907e988..b0f02305 100644 --- a/backend/app/tests/api/routes/documents/test_route_document_permanent_remove.py +++ b/backend/app/tests/api/routes/documents/test_route_document_permanent_remove.py @@ -16,11 +16,10 @@ from app.core.config import settings from app.models import Document from app.tests.utils.document import ( - DocumentStore, DocumentMaker, + DocumentStore, Route, WebCrawler, - crawler, ) diff --git a/backend/app/tests/utils/document.py b/backend/app/tests/utils/document.py index e339c1a0..bcb8b75f 100644 --- a/backend/app/tests/utils/document.py +++ b/backend/app/tests/utils/document.py @@ -7,7 +7,6 @@ from dataclasses import dataclass from urllib.parse import ParseResult, urlunparse -import pytest from httpx import Response from sqlmodel import Session, delete from fastapi.testclient import TestClient @@ -164,8 +163,3 @@ def to_public_dict(self) -> dict: result[field] = self.to_string(value) return result - - -@pytest.fixture -def crawler(client: TestClient, user_api_key: TestAuthContext) -> WebCrawler: - return WebCrawler(client, user_api_key=user_api_key)