Skip to content

test: add downloads, export, and type contracts - #206

Draft
derekmeegan wants to merge 1 commit into
feat/downloadsfrom
test/downloads-contracts
Draft

derekmeegan wants to merge 1 commit into
feat/downloadsfrom
test/downloads-contracts

Conversation

@derekmeegan

Copy link
Copy Markdown
Contributor

Moves the Python SDK contract tests from browserbase/browserbase-stlc-config#39 into this repo's CI, for the one-repo flow.

  • tests/lib/test_downloads.py covers downloads pagination, metadata, deletion, errors, the legacy ZIP endpoint, streaming without eager reads, stream_to_file(), and cancellation, both sync and async.
  • tests/lib/test_sdk_exports.py covers the public exports.
  • tests/lib/sdk_types.py is the type-level contract. pytest doesn't collect it, and ./scripts/lint checks it with pyright.

This is stacked on feat/downloads, the preview build of browserbase/browserbase-stlc-config#75. Retarget it to main after #75 merges. Nothing in it edits generated files, and the preview's own CI already passes.

The tests now use this repo's pytest settings instead of unittest: pytest classes, parametrize in place of subTest, and tmp_path, with every assertion kept. To pass strict pyright, sdk_types.py gained an __all__ for names imported only to prove they exist, and three reads of the not-required project_id carry a rule-specific pyright: ignore. mypy . excludes tests/, so in CI pyright is what checks the type file; running mypy on these files directly also passes.

Locally, ./scripts/lint passes. pytest tests/lib passes 29 tests on Python 3.9 (pydantic v2 and v1) and 3.14. The full ./scripts/test also passes with the mock server.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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