Add unit tests for helpers
Add unit tests for get_package, get_dependency, copy_path, MockDulwichRepo. Organize isolated_environment tests into test class
Pull Request Check List
Partially resolves: #9161
- [x] Added tests for changed code.
- [ ] Updated documentation for changed code.
Summary by Sourcery
Add comprehensive unit tests for helper functions in the test suite
New Features:
- Created detailed test coverage for helper utility functions in the test suite
Tests:
- Introduced new test classes for get_package, get_dependency, copy_path, and MockDulwichRepo helper functions
- Reorganized isolated_environment tests into a dedicated test class
- Added parameterized tests to cover various input scenarios and edge cases for helper functions
Reviewer's Guide by Sourcery
This pull request adds comprehensive unit tests for several helper functions, including get_package, get_dependency, copy_path, and MockDulwichRepo. It also organizes the isolated environment tests into a dedicated test class. The tests cover various scenarios and input types to ensure the correct behavior of these helper functions.
No diagrams generated as the changes look simple and do not need a visual representation.
File-Level Changes
| Change | Details | Files |
|---|---|---|
Added unit tests for the get_package helper function, covering different scenarios such as string and Version object inputs, and yanked package handling. |
|
tests/test_helpers.py |
Added unit tests for the get_dependency helper function, covering name, constraint, optional, and prerelease scenarios. |
|
tests/test_helpers.py |
Added unit tests for the copy_path helper function, covering file and directory copy scenarios to new and existing destinations. |
|
tests/test_helpers.py |
Added unit tests for the MockDulwichRepo helper class, covering initialization with different path types and head method behavior. |
|
tests/test_helpers.py |
| Organized the isolated environment tests into a test class. |
|
tests/test_helpers.py |
Tips and commands
Interacting with Sourcery
-
Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
-
Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. -
Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. -
Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. -
Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. -
Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. -
Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review! -
Generate a plan of action for an issue: Comment
@sourcery-ai planon an issue to generate a plan of action for it.
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.