Files
sapl/pytest.ini
shridhar.sabat 1aff401655 test: comprehensive backend API test suite — 208 tests for 100% module coverage
New test files covering all SAPL backend modules:

- test_auth_users_admin.py (34 tests): Login, tokens, RBAC permissions,
  user/role/dept management, scope enforcement, password security
- test_tna_pure_services.py (31 tests): leadtime_matrix, planner (19-item
  schedule), status_colors (RAG logic), escalation_matrix
- test_tna_milestone_map.py (25 tests): milestone classification, coverage
  summary, MilestoneSource dataclass
- test_tna_routes.py (53 tests): 40+ /api/tna/* endpoints — stats, line,
  orders, buyers, templates, config/rules, PERT, lifecycle, key-dates
- test_content_lifecycle.py (45 tests): garments CRUD, collections/boards,
  semantic search, review queue, RBAC enforcement
- test_infra_adapters.py (36 tests): fabrics, notifications, feed, mail,
  liveness, PWA manifest, service worker

Shared fixtures: conftest.py (base_url, admin_token, low_priv_token,
admin_headers, make_request helper). pytest.ini (custom marks, excludes
legacy container-only tests).

All tests run against live dev.ai-automation-hub.tech with structural
assertions (keys/types/relationships, not brittle exact counts).
Read-only by default — mutating endpoints marked skip.
2026-08-27 07:58:58 +05:30

15 lines
575 B
INI

[pytest]
asyncio_mode = auto
markers =
live_api: Tests that hit the live dev API (require network access)
tna_pure: Unit tests for TNA pure services (no DB/HTTP)
infra: Infrastructure adapter tests
slow: Tests that take >5s
# Exclude pre-existing tests that need chromadb/rembg (container-only)
addopts = --ignore=backend/tests/test_embedding_optimization.py
--ignore=backend/tests/test_visuals_helpers.py
--ignore=backend/tests/test_migrate_moodboard_visuals.py
--ignore=backend/tests/test_pool_session_release.py
-v