Skip to content

🧪 Add unit tests for HTTP API blueprints#44

Merged
rnovatorov merged 4 commits intomainfrom
test-http-api-blueprints-5247067827113688088
Apr 1, 2026
Merged

🧪 Add unit tests for HTTP API blueprints#44
rnovatorov merged 4 commits intomainfrom
test-http-api-blueprints-5247067827113688088

Conversation

@rnovatorov
Copy link
Copy Markdown
Member

This PR addresses the missing test coverage for the HTTP API blueprints. I have added two new test files:

  • tests/unit/test_http/test_api/test_blueprints/test_blueprint.py: Verifies the Blueprint dataclass correctly handles DTO conversions.
  • tests/unit/test_http/test_api/test_blueprints/test_client.py: Thoroughly tests the blueprints.Client class, including methods for retrieval, various upload methods (bytes, file, directory), downloading, and validation (with and without errors).

These tests ensure the reliability of the blueprint management functionality in the SDK.


PR created automatically by Jules for task 5247067827113688088 started by @rnovatorov

- Create tests for Blueprint data model (from_dto, to_dto, roundtrip)
- Create tests for Blueprints Client (get, upload, download, validate)
- Cover happy paths and error conditions
- Use pytest fixtures and mocks for isolation

Co-authored-by: rnovatorov <20299819+rnovatorov@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@rnovatorov
Copy link
Copy Markdown
Member Author

@jules, is this a dup of #41?

@google-labs-jules
Copy link
Copy Markdown
Contributor

@jules, is this a dup of #41?

Hi! I don't have access to external links like PR #41, so I cannot check if this is a duplicate. However, I noticed that the blueprint module was missing tests in the current branch, so I implemented a comprehensive set of unit tests for both the Blueprint data model and the Client. If there's another PR covering this, please let me know how you'd like to proceed!

- Implement tests for Blueprint data model and DTO conversions
- Implement tests for Blueprints Client methods: get, upload, download, validate
- Fix linting issues (black formatting) identified in CI
- Address PR feedback regarding test coverage and structure

Co-authored-by: rnovatorov <20299819+rnovatorov@users.noreply.github.com>
- Remove unused 'pathlib' and 'Blueprint' imports in test_client.py
- Apply black reformatting to test files
- Verified pass for black, ruff, isort, and mypy locally

Co-authored-by: rnovatorov <20299819+rnovatorov@users.noreply.github.com>
- Update test_upload_directory and test_validate_directory to inspect ZIP bytes
- Verify file presence and content in the generated archives
- Ensure robust testing of directory zipping logic

Co-authored-by: rnovatorov <20299819+rnovatorov@users.noreply.github.com>
@rnovatorov rnovatorov marked this pull request as ready for review April 1, 2026 13:37
@rnovatorov rnovatorov merged commit c5736c9 into main Apr 1, 2026
7 checks passed
@rnovatorov rnovatorov deleted the test-http-api-blueprints-5247067827113688088 branch April 1, 2026 13:38
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