Skip to content

test(dx): add client parity tests for Dictation and LLM Gateway - #258

Open
pylrn wants to merge 1 commit into
AssemblyAI:masterfrom
pylrn:test/dx-parity-dictation-llm-gateway
Open

pylrn wants to merge 1 commit into
AssemblyAI:masterfrom
pylrn:test/dx-parity-dictation-llm-gateway

Conversation

@pylrn

@pylrn pylrn commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Description

Extends tests/unit/test_dx.py to cover the developer-experience (DX) conventions for the newly added DictationTranscriber, AsyncDictationTranscriber, LLMGateway, and AsyncLLMGateway clients:

  1. api_key= construction:
    • DictationTranscriber and LLMGateway accept an explicit api_key= without a global key set.
    • AsyncDictationTranscriber and AsyncLLMGateway accept api_key=, manage their own client, and clean it up via aclose().
  2. api_key= precedence over caller-provided client:
    • Parametrizes all sync clients (Transcriber, SyncTranscriber, DictationTranscriber, LLMGateway) to verify that passing api_key= derives a new client while leaving the caller's client untouched.
    • Parametrizes all async clients (AsyncTranscriber, AsyncSyncTranscriber, AsyncDictationTranscriber, AsyncLLMGateway) to verify the same precedence, ownership flag, and cleanup semantics.
  3. **Async client ownership semantics (aclose())**:
    • Verifies that passing a pre-existing AsyncClient without api_key= leaves that client open when aclose() is invoked across AsyncTranscriber, AsyncSyncTranscriber, AsyncDictationTranscriber, and AsyncLLMGateway.
  4. Config type guards:
    • Verifies cross-product config rejections (DictationTranscriber rejecting TranscriptionConfig and SyncTranscriptionConfig, and prerecorded / sync transcribers rejecting DictationConfig) with descriptive type error messages.
  5. Version bump:
    • Increments __version__ to 1.6.1 to satisfy CI version bump check.

Validation

  • All 81 tests in tests/unit/test_dx.py pass.
  • Entire test suite (pytest tests/unit) passes: 734 passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant