Fill in tests - #73
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a large set of new tests, fixtures, and supporting infrastructure to close coverage gaps across oapi (client runtime/codegen, model/codegen helpers, OAS hooks and reference resolution), along with optional dependency updates for additional content encodings and some internal documentation/config files.
Changes:
- Introduces a stdlib-only local HTTP test server and many new integration-style tests for
Clientand generated client modules. - Adds focused OpenAPI fixture documents to exercise multipart, parameter styles, polymorphic schemas, and security schemes.
- Updates optional dependencies/extras (zstd + brotli) and adds initiative/spec documentation.
Reviewed changes
Copilot reviewed 41 out of 42 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_utilities.py | Unit tests for _utilities helpers + deprecated aliases. |
| tests/test_servers.py | Tests for the new local HTTP test server behavior. |
| tests/test_references.py | Tests for $ref resolver/document behaviors (incl. HTTP fetch). |
| tests/test_oas_model_hooks.py | Tests for OAS model validation/unmarshal hooks. |
| tests/test_multipart_request.py | Tests for multipart encoding types and real HTTP sending. |
| tests/test_model_module_polymorphic_schemas.py | Black-box tests validating generated model behavior for allOf/oneOf/anyOf/etc. |
| tests/test_model_module_helpers.py | Direct unit tests for helper functions in oapi.model. |
| tests/test_model_module_empty_schema.py | Test documenting a currently broken ModelModule output edge case. |
| tests/test_input_data.py | Validates newly added input-data fixtures parse/validate as OpenAPI. |
| tests/test_conftest.py | Sanity test for generated-module loader fixture. |
| tests/test_client_retry_and_encoding.py | Tests retry/backoff + content encoding round-trips. |
| tests/test_client_request_runtime.py | Integration tests for Client.request() behavior against local server. |
| tests/test_client_request_assembly.py | Tests request assembly, curl rendering, and parameter formatting helpers. |
| tests/test_client_pickling.py | Tests pickling helpers and SSLContext behaviors. |
| tests/test_client_oauth2_flows.py | Integration tests for OAuth2 flows against local server. |
| tests/test_client_module_security_schemes.py | End-to-end codegen/runtime tests for security schemes. |
| tests/test_client_module_polymorphic_responses.py | End-to-end codegen/runtime tests for polymorphic response typing. |
| tests/test_client_module_parameter_styles.py | End-to-end codegen/runtime tests for OpenAPI parameter styles. |
| tests/test_client_module_multipart.py | End-to-end codegen/runtime test for multipart request codegen. |
| tests/test_client_module_helpers.py | Unit tests for ClientModule helper utilities. |
| tests/test_client_init_and_pickling.py | Unit tests for Client init validation and pickle state behavior. |
| tests/test_client_authentication.py | Unit tests for auth header/query/cookie behavior. |
| tests/test_client_argument_formatting.py | Unit tests for argument formatting and urlencode behavior. |
| tests/servers.py | New stdlib-only HTTP server used by integration tests. |
| tests/input-data/security-schemes.json | New OpenAPI fixture for auth/security-scheme coverage. |
| tests/input-data/polymorphic-schemas.json | New OpenAPI fixture for schema merge/polymorphism coverage. |
| tests/input-data/parameter-styles.json | New OpenAPI fixture covering serialization styles. |
| tests/input-data/multipart-request-body.json | New OpenAPI fixture for multipart form-data request bodies. |
| tests/conftest.py | Shared fixtures for generating/importing generated modules/packages. |
| pyproject.toml | Adds optional deps/extras for zstandard and brotli (and includes them in test env). |
| docs/superpowers/specs/2026-08-01-test-coverage-design.md | Coverage initiative design/spec documentation. |
| docs/superpowers/plans/2026-08-02-model-module-gap-tests.md | Plan documentation for model-module gap tests. |
| AGENTS.md | Repo contribution/environment conventions and commands. |
| .gitignore | Adjusts .claude ignore/unignore rules and ignores local settings file. |
| .claude/skills/fableplan/SKILL.md | Adds a local skill document for toggling “Fable Plan Mode”. |
| .claude/settings.json | Enables the “superpowers” Claude plugin for this repo. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 35 out of 36 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
src/oapi/client.py:2744
filter(None, sob.utilities.iter_properties_values(...))does not actually filter out unset OAuth flows when the iterator yields(name, None)pairs (non-empty tuples are truthy). That can cause_get_oauth2_flow_names()to include flow names that aren’t present in the spec, since it collectsitem[0]from_iter_oauth2_flows()without checkingflow. Filter explicitly onflow is not Noneinstead.
for flow_name, flow in filter(
None,
sob.utilities.iter_properties_values(
security_scheme.flows
),
):
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new skill for toggling "Fable Plan Mode" locally in the repository, adds project documentation for the
oapiagent, and enables a Claude plugin in the local settings. The changes are focused on improving local development workflows and providing detailed documentation for contributors.Fable Plan Mode skill:
fableplanskill documentation in.claude/skills/fableplan/SKILL.md, describing how to toggle Fable 5 plan mode locally, its arguments, backup/restore behavior, and important caveats. This allows users to enable or disable Fable 5 planning for their own machine without affecting others or committing changes.Project documentation:
AGENTS.mdwith a comprehensive overview of theoapiagent: describes its purpose (generating type-safe Python API clients from OpenAPI specs), file structure, development environment, commands, CI, and conventions for contributors.Local configuration:
superpowers@claude-plugins-officialplugin by updating.claude/settings.json.