Skip to content

Commit 7036c09

Browse files
committed
clear comments from the tests file
1 parent 46ea491 commit 7036c09

33 files changed

Lines changed: 0 additions & 97 deletions

backend/tests/conftest.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import pytest
99
from fastapi.testclient import TestClient
1010

11-
1211
@pytest.fixture(scope="session")
1312
def app_instance():
1413
os.environ.setdefault("ENVIRONMENT", "development")
@@ -28,17 +27,14 @@ def app_instance():
2827

2928
return app
3029

31-
3230
@pytest.fixture
3331
def test_org_id() -> UUID:
3432
return uuid4()
3533

36-
3734
@pytest.fixture
3835
def test_user_id() -> UUID:
3936
return uuid4()
4037

41-
4238
@pytest.fixture
4339
def auth_claims(test_user_id: UUID, test_org_id: UUID) -> dict:
4440
return {
@@ -50,13 +46,11 @@ def auth_claims(test_user_id: UUID, test_org_id: UUID) -> dict:
5046
"type": "access",
5147
}
5248

53-
5449
@pytest.fixture
5550
def api_client(app_instance) -> Iterator[TestClient]:
5651
with TestClient(app_instance) as client:
5752
yield client
5853

59-
6054
@pytest.fixture
6155
def authed_client(
6256
api_client: TestClient, auth_claims: dict, app_instance
@@ -70,21 +64,18 @@ async def _override() -> dict:
7064
yield api_client
7165
app_instance.dependency_overrides.pop(get_current_claims, None)
7266

73-
7467
@pytest.fixture
7568
def storage_dir(tmp_path: Path) -> Path:
7669
path = tmp_path / "object-storage"
7770
path.mkdir()
7871
os.environ["DOCUMENT_STORAGE_DIR"] = str(path)
7972
return path
8073

81-
8274
@pytest.fixture(autouse=True)
8375
def _clear_dependency_overrides(app_instance) -> Iterator[None]:
8476
yield
8577
app_instance.dependency_overrides.clear()
8678

87-
8879
@pytest.fixture
8980
def sample_text_bytes() -> bytes:
9081
return b"Hello MindVault.\n\nThis is a test document for chunking."

backend/tests/contract/test_object_storage_contract.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from app.adapters.outbound.storage.local_storage import LocalObjectStorage
88

9-
109
@pytest.mark.contract
1110
class TestObjectStorageContract:
1211
"""Behaviors required by all ObjectStorage implementations."""

backend/tests/helpers/mocks.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from app.domain.entities.user import User
1313
from app.domain.value_objects.membership_status import MembershipStatus
1414

15-
1615
@dataclass
1716
class FakeUserRepo:
1817
by_email: dict[str, User] = field(default_factory=dict)
@@ -33,7 +32,6 @@ async def update_last_login(self, *, user_id: UUID) -> None:
3332
if user:
3433
user.last_login_at = user.last_login_at
3534

36-
3735
@dataclass
3836
class FakeOrgRepo:
3937
slugs: set[str] = field(default_factory=set)
@@ -47,7 +45,6 @@ async def create_org(self, *, org: Organization) -> Organization:
4745
self.orgs[org.id] = org
4846
return org
4947

50-
5148
@dataclass
5249
class FakeMembershipRepo:
5350
memberships: list[OrganizationMembership] = field(default_factory=list)
@@ -80,7 +77,6 @@ async def list_user_memberships(
8077
) -> list[OrganizationMembership]:
8178
return [m for m in self.memberships if m.user_id == user_id]
8279

83-
8480
class FakeUoW:
8581
def __init__(
8682
self,
@@ -106,14 +102,12 @@ async def commit(self) -> None:
106102
async def rollback(self) -> None:
107103
pass
108104

109-
110105
def uow_factory(uow: FakeUoW):
111106
def _factory() -> FakeUoW:
112107
return uow
113108

114109
return _factory
115110

116-
117111
@dataclass
118112
class FakeDocumentRepo:
119113
documents: dict[UUID, Document] = field(default_factory=dict)
@@ -185,7 +179,6 @@ def count_failed_by_org(self, org_id: str) -> int:
185179
if d.org_id == oid and d.status == DocumentStatus.FAILED
186180
)
187181

188-
189182
@dataclass
190183
class FakeChunkRepo:
191184
chunks: list[Any] = field(default_factory=list)
@@ -197,7 +190,6 @@ def count_by_org(self, org_id: str) -> int:
197190
oid = UUID(org_id) if isinstance(org_id, str) else org_id
198191
return sum(1 for c in self.chunks if c.org_id == oid)
199192

200-
201193
@dataclass
202194
class FakeSyncDocumentRepo:
203195
documents: dict[UUID, Document] = field(default_factory=dict)
@@ -224,7 +216,6 @@ def update_status(
224216
if token_count is not None:
225217
doc.token_count = token_count
226218

227-
228219
@dataclass
229220
class FakeSyncChunkRepo:
230221
chunks: list[Any] = field(default_factory=list)
@@ -235,7 +226,6 @@ def add_many(self, chunks: list) -> None:
235226
def delete_by_document(self, *, document_id: UUID) -> None:
236227
self.chunks = [c for c in self.chunks if c.document_id != document_id]
237228

238-
239229
class FakeMemoryStorage:
240230
"""Minimal ObjectStorage fake."""
241231

@@ -254,12 +244,10 @@ def get_object(self, *, key: str) -> bytes:
254244
def delete_object(self, *, key: str) -> None:
255245
self._objects.pop(key, None)
256246

257-
258247
class FakeEmbedder:
259248
def embed_texts(self, texts: list[str]) -> list[list[float]]:
260249
return [[0.1, 0.2, 0.3] for _ in texts]
261250

262-
263251
class FakeVectorStore:
264252
def __init__(self) -> None:
265253
self.upserted: list[dict] = []
@@ -273,7 +261,6 @@ async def query_by_similarity(self, **kwargs: Any) -> list[dict]:
273261
async def delete_by_document_id(self, *, document_id: str, namespace: str) -> None:
274262
pass
275263

276-
277264
def make_document(
278265
*,
279266
org_id: UUID | None = None,

backend/tests/integration/test_auth_routes.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from app.infrastructure.di.container import Container
1616
from app.main import app
1717

18-
1918
@pytest.mark.integration
2019
def test_register_success(api_client, monkeypatch) -> None:
2120
class FakeRegister:
@@ -40,7 +39,6 @@ async def execute(self, command):
4039
assert "user_id" in data
4140
assert "default_org_id" in data
4241

43-
4442
@pytest.mark.integration
4543
def test_register_conflict_on_duplicate(api_client) -> None:
4644
class FailingRegister:
@@ -62,7 +60,6 @@ async def execute(self, command):
6260
app.dependency_overrides.pop(Container.get_register_user_service, None)
6361
assert response.status_code == 409
6462

65-
6663
@pytest.mark.integration
6764
def test_login_success(api_client) -> None:
6865
class FakeIAM:
@@ -82,13 +79,11 @@ async def login(self, **kwargs):
8279
assert response.status_code == 200
8380
assert response.json()["access_token"] == "access"
8481

85-
8682
@pytest.mark.integration
8783
def test_me_requires_auth(api_client) -> None:
8884
response = api_client.get("/api/v1/auth/me")
8985
assert response.status_code == 401
9086

91-
9287
@pytest.mark.integration
9388
def test_me_returns_claims(authed_client, auth_claims) -> None:
9489
response = authed_client.get("/api/v1/auth/me")
@@ -97,7 +92,6 @@ def test_me_returns_claims(authed_client, auth_claims) -> None:
9792
assert body["user_id"] == auth_claims["sub"]
9893
assert body["org_id"] == auth_claims["org_id"]
9994

100-
10195
@pytest.mark.integration
10296
def test_switch_org(authed_client, test_user_id, test_org_id) -> None:
10397
class FakeSwitch:

backend/tests/integration/test_chat_routes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from app.infrastructure.di.container import Container
1010
from app.main import app
1111

12-
1312
@pytest.mark.integration
1413
def test_chat_streams_plain_text(authed_client) -> None:
1514
class FakeChatService:

backend/tests/integration/test_documents_routes.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
ROUTES = "app.adapters.inbound.api.v1.routes_documents"
1818

19-
2019
@pytest.mark.integration
2120
def test_upload_document_accepted(authed_client, test_org_id, monkeypatch) -> None:
2221
doc = make_document(org_id=test_org_id)
@@ -35,7 +34,6 @@ async def execute(self, command):
3534
assert response.status_code == 202
3635
assert response.json()["id"] == str(doc.id)
3736

38-
3937
@pytest.mark.integration
4038
def test_upload_empty_file_400(authed_client, monkeypatch) -> None:
4139
service = IngestDocumentService(
@@ -53,7 +51,6 @@ def test_upload_empty_file_400(authed_client, monkeypatch) -> None:
5351
)
5452
assert response.status_code == 400
5553

56-
5754
@pytest.mark.integration
5855
def test_list_documents(authed_client, test_org_id, monkeypatch) -> None:
5956
doc = make_document(org_id=test_org_id)
@@ -68,7 +65,6 @@ def test_list_documents(authed_client, test_org_id, monkeypatch) -> None:
6865
assert body["total"] == 1
6966
assert body["items"][0]["id"] == str(doc.id)
7067

71-
7268
@pytest.mark.integration
7369
def test_get_document_not_found(authed_client, monkeypatch) -> None:
7470
monkeypatch.setattr(f"{ROUTES}.get_document_repository", lambda: FakeDocumentRepo())
@@ -78,7 +74,6 @@ def test_get_document_not_found(authed_client, monkeypatch) -> None:
7874
)
7975
assert response.status_code == 404
8076

81-
8277
@pytest.mark.integration
8378
def test_list_chunks(authed_client, test_org_id, monkeypatch) -> None:
8479
doc = make_document(org_id=test_org_id)

backend/tests/integration/test_health.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import pytest
66

7-
87
@pytest.mark.integration
98
def test_health_returns_ok(api_client) -> None:
109
response = api_client.get("/health")

backend/tests/integration/test_retrieval_policy.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Integration tests for retrieval policy end-to-end flow."""
22

3-
43
class TestRetrievalPolicyIntegration:
54
"""Integration tests for complete retrieval pipeline."""
65

backend/tests/unit/adapters/test_infer_source_type.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from app.adapters.inbound.api.v1.routes_documents import _infer_source_type
88

9-
109
@pytest.mark.unit
1110
class TestInferSourceType:
1211
def test_from_pdf_content_type(self) -> None:

backend/tests/unit/adapters/test_key_retriever.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Unit tests for key retriever adapter."""
22

3-
43
class TestKeyRetriever:
54
"""Tests for KeyRetriever class."""
65

0 commit comments

Comments
 (0)