Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions backend/app/tests/api/routes/documents/conftest.py
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
DocumentStore,
Route,
WebCrawler,
crawler,
httpx_to_standard,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
DocumentStore,
Route,
WebCrawler,
crawler,
httpx_to_standard,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)


Expand Down
6 changes: 0 additions & 6 deletions backend/app/tests/utils/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)