Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add get_args tests #24

Merged
merged 9 commits into from
Aug 1, 2024
Merged

test: add get_args tests #24

merged 9 commits into from
Aug 1, 2024

Conversation

athith-g
Copy link
Collaborator

@athith-g athith-g commented Jul 29, 2024

Adds tests for get_args().

Summary by Sourcery

This pull request introduces unit tests for the get_args function, covering scenarios such as correct argument parsing, default output directory, invalid arguments, and missing file paths.

  • Tests:
    • Added unit tests for the get_args function to ensure correct argument parsing, default values, and error handling.

Copy link

sourcery-ai bot commented Jul 29, 2024

Reviewer's Guide by Sourcery

This pull request adds unit tests for the get_args function in the crypt4gh_middleware/decrypt.py file. The tests cover various scenarios including correct argument parsing, default values, and handling of invalid arguments.

File-Level Changes

Files Changes
tests/decryption/test_decrypt.py Added unit tests for the get_args function, covering argument parsing, default values, and error handling.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @athith-g - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a test case for multiple file paths to ensure that scenario is handled correctly.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟡 Testing: 2 issues found
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

tests/decryption/test_decrypt.py Outdated Show resolved Hide resolved
tests/decryption/test_decrypt.py Show resolved Hide resolved
Copy link
Collaborator

@jvkersch jvkersch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Maybe one small thing that I would do is to create a helper function to patch sys.argv:

@contextlib.contextmanager
def patch_cli(args):
    with mock.patch("sys.argv", args):
        yield

This would make it a bit easier to track what is being patched IMO, but it is a very minor comment.

@athith-g athith-g requested a review from jvkersch July 30, 2024 22:14
@uniqueg uniqueg changed the title test: add tests for get_args test: add get_args tests Jul 31, 2024
Copy link
Member

@uniqueg uniqueg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@athith-g athith-g merged commit fefefa3 into main Aug 1, 2024
1 check passed
@athith-g athith-g deleted the add_args_tests branch August 1, 2024 18:34
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.

3 participants