🧪 Add error test for parse_command_arguments#36
Conversation
This change adds comprehensive unit tests for the `parse_command_arguments` function in `src/enapter/cli/http/api/command_arguments.py`. 🎯 **What:** The testing gap addressed was the lack of validation for the JSON decoding error path. 📊 **Coverage:** The new tests cover: - Passing `None` (returns empty dict) - Passing valid JSON (returns parsed dict) - Passing invalid JSON (raises `argparse.ArgumentTypeError`) ✨ **Result:** Improved reliability and code coverage for CLI argument parsing. Co-authored-by: rnovatorov <20299819+rnovatorov@users.noreply.github.com>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This version includes proper formatting to satisfy the `black` linter, which caused a CI failure in the previous submission. 🎯 **What:** The testing gap addressed was the lack of validation for the JSON decoding error path. 📊 **Coverage:** The new tests cover: - Passing `None` (returns empty dict) - Passing valid JSON (returns parsed dict) - Passing invalid JSON (raises `argparse.ArgumentTypeError`) ✨ **Result:** Improved reliability and code coverage for CLI argument parsing, now with lint-passing code. Co-authored-by: rnovatorov <20299819+rnovatorov@users.noreply.github.com>
tests/unit/test_cli/test_http/test_api/test_command_arguments.py
Outdated
Show resolved
Hide resolved
Updated the test file to import the `command_arguments` module instead of the `parse_command_arguments` function directly, following the project's coding conventions as requested in the PR review. Co-authored-by: rnovatorov <20299819+rnovatorov@users.noreply.github.com>
Added unit tests for
parse_command_argumentsto ensure correct handling of valid/invalid JSON andNoneinputs, fulfilling the request to test the error path.PR created automatically by Jules for task 8490786769286108830 started by @rnovatorov