test: Add unit test for pydumpling/cli.py
Trigger Info
| Trigger Type | Triggered By | Source File | Assignment |
|---|---|---|---|
| Manual | cocolato | pydumpling/cli.py | Detail |
Summary
This PR introduces unit tests for the pydumpling CLI, ensuring robust validation and functionality. Key highlights include:
-
Validation Tests:
- Added tests for
validate_file_nameto handle valid.dumpfiles, invalid extensions, empty filenames, and non-existent files.
- Added tests for
-
Main Functionality Tests:
-
Tested
mainfunction for--print,--debug, and--rdebugactions, ensuring proper calls to respective handlers. -
Mocked dependencies like
os.path.existsand CLI-specific functions for isolated testing.
-
-
Parser Tests:
-
Verified behavior for missing arguments, multiple conflicting actions, and invalid filenames.
-
Ensured
--helpdisplays the correct CLI usage information.
-
These tests improve coverage and reliability for the pydumpling CLI.
[!TIP] You can
@gru-agentand leave your feedback. TestGru will make adjustments based on your input
[!TIP] You can
@gru-agent rebaseto rebase the PR.
[!TIP] You can
@gru-agent redoto reset or rebase before redoing the PR.
[!TIP] To modify the test code yourself, click here Edit Test Code