Skip to content

Tests

Tests

This repository has a large and valuable regression suite. The wiki should point to the test families that prove the behavior documented elsewhere.

Major evidence clusters

Authentication and tenancy

  • tests/unit/auth/test_auth.py
  • tests/unit/auth/test_login_throttle.py
  • tests/unit/auth/test_ms_tenant_org.py
  • tests/unit/auth/test_auth_and_tenancy_contracts.py
  • tests/integration/test_authentication.py

These suites are the best evidence for login, token refresh, Microsoft auth, tenant creation, and membership coupling.

Document processing

  • api/tests/test_document_edit_audit.py
  • api/tests/test_edit_history.py
  • tests/integration/test_document_processing.py
  • tests/integration/test_async_document_processing.py
  • tests/unit/processing/test_upload_validation.py
  • tests/unit/processing/test_document_classification_toggle.py

These suites cover upload validation, async task behavior, edit diffs, edit-history persistence, and status semantics.

Schema management

  • tests/unit/schema/test_schema_generator.py
  • tests/unit/schema/test_schema_import_export.py
  • tests/unit/schema/test_schema_versioning.py
  • tests/unit/schema/test_schema_generator_endpoints.py
  • tests/integration/test_schema_selection_integration.py

These suites prove schema CRUD, generation, import/export, and route behavior.

File management, storage, and serving

  • tests/integration/test_file_management.py
  • tests/unit/storage/test_azure_storage.py
  • tests/unit/storage/test_virus_scan_integration.py
  • tests/unit/misc/test_upload_config.py

These suites verify upload constraints, storage abstraction behavior, and file-handling configuration.

Billing, logs, chatbot, and security

  • tests/integration/test_chatbot.py
  • tests/integration/test_health.py
  • tests/unit/api/test_csp.py
  • activity-log and billing tests under tests/unit and tests/integration

Validation strategy

Prefer the narrowest suite that proves the changed invariant:

  • route shape change → endpoint-focused unit or integration test
  • service behavior change → service unit test
  • upload/processing workflow change → document-processing integration test
  • auth or tenancy change → auth/tenant contract tests

Reserve a broad integration run for changes that cross multiple subsystems or when the narrow suite reveals a contract break.

Scope boundary

This page is a navigation aid. For the behavior behind the tests, read the relevant subsystem page.