# PodcastItLater Testing Strategy ## Overview We use `pytest` with `Omni.Test` integration. Tests are co-located with code or in `Biz/PodcastItLater/Test.py` for E2E. ## Test Categories ### 1. Core (Database/Logic) - **Location**: `Biz/PodcastItLater/Core.py` - **Scope**: User creation, Job queue ops, Episode management. - **Key Tests**: - `test_create_user`: Unique tokens. - `test_queue_isolation`: Users see only their jobs. ### 2. Web (HTTP/UI) - **Location**: `Biz/PodcastItLater/Web.py` - **Scope**: Routes, Auth, HTMX responses. - **Key Tests**: - `test_submit_requires_auth`. - `test_rss_feed_xml`. - `test_admin_access_control`. ### 3. Worker (Processing) - **Location**: `Biz/PodcastItLater/Worker.py` - **Scope**: Extraction, TTS, S3 upload. - **Key Tests**: - `test_extract_content`: Mocked network calls. - `test_tts_chunking`: Handle long text. - **Error Handling**: Ensure retries work and errors are logged. ### 4. Billing (Stripe) - **Location**: `Biz/PodcastItLater/Billing.py` - **Scope**: Webhook processing, Entitlement checks. - **Key Tests**: - `test_webhook_subscription_update`: Update local DB. - `test_enforce_limits`: Block submission if over limit. ## Running Tests ```bash # Run all bild --test Biz/PodcastItLater.hs # Run specific file ./Biz/PodcastItLater/Web.py test ```