-
Notifications
You must be signed in to change notification settings - Fork 49
DcnmBootflash unit-test linter reformatting, and update copyright #554
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
Conversation
No functional changes in this commit. This commit adds type hints and removes class decorator @Properties.add_rest_send in favor of a class property for RestSend.
No functional changes in this commit. Run linters to fix Ansible sanity tests for dcnm_bootflash.py
1. Address Copilot review commit regarding unused import. 2. Run black linter 3. Add pylint directive to suppress invalid-name.
1. Update copyright for all files 2. Add pylint directive to suppress invalid-name for __metaclass__ 3. Run linters (black reformatted multiple lines to new relaxed line length)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the DcnmBootflash module and its unit tests with linter fixes, code reformatting, and copyright updates. While the PR description states "No functional changes," several logic modifications in conditional statements alter validation behavior in potentially breaking ways.
Key Changes
- Added
# pylint: disable=invalid-namedirectives for__metaclass__assignments across all test files and the main module - Reformatted imports and multi-line statements to single lines using black formatter
- Updated copyright headers from "2024" to "2024-2025" across all files
- Added type annotations throughout
dcnm_bootflash.pyand introducedfrom typing import Anyimport - Changed
_rest_sendinitialization fromNonetoRestSend({})with corresponding test updates - Added explicit
rest_sendproperty getter/setter implementation - Modified conditional logic from explicit
is Nonechecks to truthy/falsy checks (behavioral change)
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/modules/dcnm/dcnm_bootflash/utils.py | Added pylint directive, copyright update, consolidated multi-line imports, added author metadata |
| tests/unit/modules/dcnm/dcnm_bootflash/test_convert_target_to_params.py | Added pylint directive, updated copyright, consolidated imports |
| tests/unit/modules/dcnm/dcnm_bootflash/test_convert_file_info_to_target.py | Added pylint directive, updated copyright, consolidated imports and simplified multi-line string concatenation |
| tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_query.py | Added pylint directive, updated copyright, consolidated imports, updated test assertions to expect initialized RestSend instead of None |
| tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_info.py | Added pylint directive, updated copyright, consolidated multi-line imports |
| tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_files.py | Added pylint directive, updated copyright, consolidated imports, simplified multi-line assertions and decorators |
| tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_deleted.py | Added pylint directive, updated copyright, consolidated imports, updated test assertions for initialized RestSend, simplified assertions |
| tests/unit/modules/dcnm/dcnm_bootflash/test_bootflash_common.py | Added pylint directive, updated copyright, consolidated imports, updated test assertions for initialized RestSend |
| tests/unit/modules/dcnm/dcnm_bootflash/fixture.py | Added pylint directive, copyright update, added author metadata |
| plugins/modules/dcnm_bootflash.py | Added pylint directive, consolidated imports, added type annotations, changed _rest_send initialization, added rest_send property, modified validation conditionals (behavioral changes), improved error handling in main(), documentation formatting inconsistencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Closing this in favor of updating individual unit tests along with their associated files in module_utils. |
No functional changes in this PR.
** PLEASE MERGE THIS PR AFTER MERGING #553 **
This PR fixes various linter complaints and updates copyright dates. Specifically: