-
Notifications
You must be signed in to change notification settings - Fork 50
dcnm_maintenance_mode: integration test updates #579
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
base: develop
Are you sure you want to change the base?
Conversation
No functional changes in this commit. Run black and isort.
No functional changes in this commit. Run black and isort linters against MaintenanceMode.
No functional changes in this commit. Run black and isort linters against dcnm_maintenance_mode.py.
No functional changes in this commit. Run black and isort linters against unit test files for dcnm_maintenance_mode.
No functional changes in this commit. This commit updates all docstrings to conform to the standards defined in CLAUDE.md (not in this repository). These standards include: 1. Structured headings # Summary ## Raises ### ValueError ## Other heading …etc 2. Single backticks around class, method, var, names, exception names, etc.
Fix below error: ERROR: tests/unit/module_utils/common/test_maintenance_mode.py:1238:161: E501: line too long (181 > 160 characters)
Add type hints for all vars and type annotations for all methods.
Certain dcnm_maintenance_mode unit test asserts will fail due to the changes in the last commit. Fixing that in this commit.
No functional changes in this commit. 1. Update all docstrings to conform to Markdown format. 2. Add module dostrings where missing. 3. Add pylint supression directive for __metaclass__ invalid-name
No functional changes in this commit. Update copyright dates for all unit test files associuated with dcnm_maintenance_mode.
1. Suppress invalid-name for __metaclass__ 2. Add module docstring
1. Add type hints for dcnm_maintenance_mode module and support classes. 2. Replace class decorators for RestSend and Results with local properties. - plugins/module_utils/common/maintenance_mode.py - plugins/module_utils/common/maintenance_mode_info.py - plugins/modules/dcnm_maintenance_mode.py 3. Update unit tests for the above 4. Some unit tests related to verifying Results is set are removed since they are no longer needed given that Results is instantiated in class initializers. 5. Add enums for maintenance mode values (e.g, “normal” “maintenance”).
1. Add blank lines where linters prefer them. 2. Move import after DOCUMENTATION.
Use the standard fabric_type and fabric_name numbering, e.g.: fabric_name_00 - VXLAN_EVPN fabric_type_00 - VXLAN_EVPN
…-mode-integration-tests
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 dcnm_maintenance_mode integration tests to use standardized fabric naming conventions (fabric_name_00/fabric_type_00 and fabric_name_10/fabric_type_10 instead of fabric_name_1/fabric_type_1 and fabric_name_3/fabric_type_3). Additionally, the PR includes extensive code quality improvements across unit tests and module files, including:
- Addition of module docstrings and improved inline documentation
- Type hints using Python's typing module
- Conversion to Markdown-style documentation format
- Code formatting improvements (import consolidation, line wrapping)
- Addition of a new enums.py file for maintenance mode value definitions
- Removal of deprecated Properties decorators in favor of explicit property implementations
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/targets/dcnm_maintenance_mode/tests/README.md | Updated fabric naming from fabric_name_1/3 to fabric_name_00/10 |
| tests/integration/targets/dcnm_maintenance_mode/tests/00_setup_fabrics_1x_rw.yaml | Updated fabric references and task descriptions for new naming convention |
| tests/integration/targets/dcnm_maintenance_mode/tests/00_setup_fabrics_2x_rw.yaml | Updated fabric references and task descriptions for new naming convention |
| tests/integration/targets/dcnm_maintenance_mode/tests/01-09_*.yaml | Updated fabric references in comments for all test files |
| tests/unit/modules/dcnm/dcnm_maintenance_mode/utils.py | Added docstring, improved imports, added pylint disables |
| tests/unit/modules/dcnm/dcnm_maintenance_mode/test_dcnm_maintenance_mode_want.py | Updated copyright, improved docstrings, removed unnecessary test cases, added type ignore comments |
| tests/unit/modules/dcnm/dcnm_maintenance_mode/test_dcnm_maintenance_mode_query.py | Updated copyright, improved docstrings, consolidated imports |
| tests/unit/modules/dcnm/dcnm_maintenance_mode/test_dcnm_maintenance_mode_params_spec.py | Updated copyright, improved docstrings, added type ignore comment |
| tests/unit/modules/dcnm/dcnm_maintenance_mode/test_dcnm_maintenance_mode_merged.py | Updated copyright, improved docstrings, consolidated imports |
| tests/unit/modules/dcnm/dcnm_maintenance_mode/test_dcnm_maintenance_mode_common.py | Updated copyright, improved docstrings, test logic updates |
| tests/unit/modules/dcnm/dcnm_maintenance_mode/fixtures/configs_Want.json | Removed obsolete test fixtures for deleted test cases |
| tests/unit/module_utils/common/test_maintenance_mode_info.py | Added docstring, improved documentation format, consolidated imports, added type ignore comments |
| tests/unit/module_utils/common/test_maintenance_mode.py | Added docstring, improved documentation, consolidated imports, updated test references |
| tests/unit/module_utils/common/common_utils.py | Added docstring, copyright update, added pylint disable |
| plugins/modules/dcnm_maintenance_mode.py | Added docstring, type hints, improved documentation, removed Properties decorator, added enums usage |
| plugins/module_utils/common/maintenance_mode_info.py | Added docstring, type hints, improved documentation, removed Properties decorator, added explicit property implementations |
| plugins/module_utils/common/maintenance_mode.py | Added docstring, type hints, improved documentation, removed Properties decorator, added enums usage |
| plugins/module_utils/common/enums.py | New file defining MaintenanceModeSetEnum and MaintenanceModeGetEnum |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
This PR updates dcnm_maintenance_mode integration tests with standard fabric_type and fabric_name numbering defined in #569.
All integration tests are passing using the updates in #578.
Notes to reviewers