e0075989df
- test_folders.py: 13 stubs for FOLD-01..05 (create, rename, delete, move, breadcrumb, sort, FTS)
- test_shares.py: 7 stubs for SHARE-01..05 (share, received list, quota isolation, revoke, duplicate)
- FTS tests carry both xfail and skipif(INTEGRATION) decorators
- All stubs: xfail(strict=False), body is pytest.xfail("not implemented yet")
124 lines
4.1 KiB
Python
124 lines
4.1 KiB
Python
"""
|
|
Folder API tests — Wave 0 xfail stubs for Phase 4.
|
|
|
|
All tests in this file are xfail stubs. They will be implemented in Plans 04-02
|
|
through 04-04. The stubs ensure pytest collects them and keeps CI green before
|
|
implementation code exists.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
import pytest
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# FOLD-01: Create folder
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
@pytest.mark.xfail(strict=False)
|
|
async def test_create_folder(async_client, auth_user):
|
|
"""POST /api/folders creates a folder, returns 201."""
|
|
pytest.xfail("not implemented yet")
|
|
|
|
|
|
@pytest.mark.xfail(strict=False)
|
|
async def test_create_folder_duplicate_name(async_client, auth_user):
|
|
"""POST /api/folders with same name under same parent returns 409."""
|
|
pytest.xfail("not implemented yet")
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# FOLD-02: Rename folder
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
@pytest.mark.xfail(strict=False)
|
|
async def test_rename_folder(async_client, auth_user):
|
|
"""PATCH /api/folders/{id} changes name, returns 200."""
|
|
pytest.xfail("not implemented yet")
|
|
|
|
|
|
@pytest.mark.xfail(strict=False)
|
|
async def test_rename_folder_wrong_owner(async_client, auth_user):
|
|
"""PATCH /api/folders/{id} by non-owner returns 404."""
|
|
pytest.xfail("not implemented yet")
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# FOLD-03: Delete folder
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
@pytest.mark.xfail(strict=False)
|
|
async def test_delete_empty_folder(async_client, auth_user):
|
|
"""DELETE /api/folders/{id} on empty folder returns 204."""
|
|
pytest.xfail("not implemented yet")
|
|
|
|
|
|
@pytest.mark.xfail(strict=False)
|
|
async def test_delete_folder_cascade(async_client, auth_user):
|
|
"""DELETE /api/folders/{id} on non-empty folder deletes all docs + decrements quota."""
|
|
pytest.xfail("not implemented yet")
|
|
|
|
|
|
@pytest.mark.xfail(strict=False)
|
|
async def test_delete_folder_wrong_owner(async_client, auth_user):
|
|
"""DELETE /api/folders/{id} by non-owner returns 404."""
|
|
pytest.xfail("not implemented yet")
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# FOLD-04: Move document
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
@pytest.mark.xfail(strict=False)
|
|
async def test_move_document(async_client, auth_user):
|
|
"""PATCH /api/documents/{id}/folder moves doc to target folder, returns 200."""
|
|
pytest.xfail("not implemented yet")
|
|
|
|
|
|
@pytest.mark.xfail(strict=False)
|
|
async def test_move_wrong_owner_404(async_client, auth_user):
|
|
"""PATCH /api/documents/{id}/folder where doc or target folder belongs to other user returns 404."""
|
|
pytest.xfail("not implemented yet")
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# FOLD-05: Breadcrumb, sort, FTS
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
@pytest.mark.xfail(strict=False)
|
|
async def test_breadcrumb_path(async_client, auth_user):
|
|
"""GET /api/folders/{id} returns breadcrumb array of {id, name} from root to current."""
|
|
pytest.xfail("not implemented yet")
|
|
|
|
|
|
@pytest.mark.xfail(strict=False)
|
|
async def test_document_sort(async_client, auth_user):
|
|
"""GET /api/documents?sort=name|date|size returns correctly ordered results."""
|
|
pytest.xfail("not implemented yet")
|
|
|
|
|
|
@pytest.mark.xfail(strict=False)
|
|
@pytest.mark.skipif(
|
|
not os.environ.get("INTEGRATION"),
|
|
reason="requires PostgreSQL",
|
|
)
|
|
async def test_fts_search(async_client, auth_user):
|
|
"""GET /api/documents?q=term returns matching docs only; requires PostgreSQL FTS."""
|
|
pytest.xfail("not implemented yet")
|
|
|
|
|
|
@pytest.mark.xfail(strict=False)
|
|
@pytest.mark.skipif(
|
|
not os.environ.get("INTEGRATION"),
|
|
reason="requires PostgreSQL",
|
|
)
|
|
async def test_fts_search_scoped_to_owner(async_client, auth_user):
|
|
"""GET /api/documents?q=term does not return other user's matching docs."""
|
|
pytest.xfail("not implemented yet")
|