Skip to content

test: add unit tests for the sync (SyncTranscriber) client#216

Draft
ccampbell-aai wants to merge 1 commit into
masterfrom
ccampbell/add-sync-unit-tests
Draft

test: add unit tests for the sync (SyncTranscriber) client#216
ccampbell-aai wants to merge 1 commit into
masterfrom
ccampbell/add-sync-unit-tests

Conversation

@ccampbell-aai

Copy link
Copy Markdown
Contributor

What

Adds unit tests for the sync client (assemblyai.sync, SyncTranscriber), which currently has no test coverage in this repo.

  • tests/unit/test_sync.py — request/response behavior: bytes / raw-PCM / WAV input routing, config serialization, X-AAI-Model header, warm() pre-warming, error mapping (SyncTranscriptError), client-side timeout.
  • tests/unit/test_sync_backwards_compat.py — the flat assemblyai.sync / assemblyai.sync_api re-export shims still resolve after the sync/v1 restructure.

Why

These suites lived only in AssemblyAI's internal monorepo, where until now they were the sole automated coverage for the sync client. As SDK development moves to this public repo as the source of truth (the internal copy is being de-vendored and materialized from here at build time), that internal coverage would otherwise disappear. Sync is under active development — keyterms rename, warm(), latency work — so it shouldn't go untested.

Notes

  • Import paths were re-rooted from the internal package path to assemblyai.*; no test logic changed.
  • Uses pytest-httpx (already in tox.ini).
  • Verified locally against the current package: pytest tests/unit/test_sync.py tests/unit/test_sync_backwards_compat.py38 passed.

The sync client (`assemblyai.sync`, `SyncTranscriber`) currently has no test
coverage in this repository. These two suites existed only in AssemblyAI's
internal monorepo, where they were the sole automated coverage for the sync
client. As SDK development moves to this public repo as the source of truth,
they're upstreamed here so sync stays covered — it's under active development
(keyterms rename, `warm()` pre-warming, latency work).

- test_sync.py: request/response behavior (bytes/PCM/WAV input, config
  serialization, model header routing, warm(), error mapping, timeouts).
- test_sync_backwards_compat.py: the flat `assemblyai.sync` / `sync_api`
  re-export shims still resolve after the sync/v1 restructure.

Import paths were re-rooted from the internal package path to `assemblyai.*`.
Verified locally: `pytest tests/unit/test_sync.py
tests/unit/test_sync_backwards_compat.py` → 38 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