-
Notifications
You must be signed in to change notification settings - Fork 4
Update dependencies, add unit tests, and fix descriptions #193
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: master
Are you sure you want to change the base?
Conversation
Co-authored-by: JanuszNowak <5168275+JanuszNowak@users.noreply.github.com>
|
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 addresses technical debt by updating dependencies, adding comprehensive unit test coverage, and fixing documentation issues. The changes are backward compatible and improve code quality.
- Updated pre-commit hooks (v4.5.0 → v5.0.0) and GitHub Actions setup-python (v5.3.0 → v5.3.1)
- Added 8 new unit tests covering both
az_bicep_buildandaz_bicep_formatfunctions - Fixed typo in README.md and enhanced setup.py descriptions
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_az_bicep_build.py | New unit tests for bicep build function covering no files, success, errors, and multiple files scenarios |
| tests/test_az_bicep_format.py | New unit tests for bicep format function covering no files, success, errors, and multiple files scenarios |
| setup.py | Removed unnecessary f-string, added long_description from README.md, and enhanced package description |
| README.md | Fixed typo: "innstall" → "install" |
| .pre-commit-config.yaml | Updated pre-commit hooks version from v4.5.0 to v5.0.0 |
| .github/workflows/github-action-ci.yml | Updated setup-python action from v5.3.0 to v5.3.1 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def test_bicep_format_no_files(self, mock_glob, mock_run): | ||
| """Test bicep format when no bicep files are found.""" | ||
| mock_glob.return_value = [] | ||
| mock_run.return_value = MagicMock(stdout="Bicep CLI version 0.4.1008", stderr=b"") |
Copilot
AI
Nov 16, 2025
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.
The mock for the version check incorrectly uses stderr=b"" (bytes). Since the actual subprocess.run call uses text=True, stderr should be an empty string "" instead of bytes b"".
|
|
||
| # Mock version and format calls (no upgrade because --noupgrade is hardcoded) | ||
| mock_run.side_effect = [ | ||
| MagicMock(stdout="Bicep CLI version 0.4.1008", stderr=b""), |
Copilot
AI
Nov 16, 2025
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.
The mock for the version check in the side_effect list incorrectly uses stderr=b"" (bytes). Since the actual subprocess.run call uses text=True, stderr should be an empty string "" instead of bytes b"".
|
|
||
| # Mock version and failed format (no upgrade because --noupgrade is hardcoded) | ||
| mock_run.side_effect = [ | ||
| MagicMock(stdout="Bicep CLI version 0.4.1008", stderr=b""), |
Copilot
AI
Nov 16, 2025
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.
The mock for the version check in the side_effect list incorrectly uses stderr=b"" (bytes). Since the actual subprocess.run call uses text=True, stderr should be an empty string "" instead of bytes b"".
|
|
||
| # Mock version and two successful formats (no upgrade because --noupgrade is hardcoded) | ||
| mock_run.side_effect = [ | ||
| MagicMock(stdout="Bicep CLI version 0.4.1008", stderr=b""), |
Copilot
AI
Nov 16, 2025
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.
The mock for the version check in the side_effect list incorrectly uses stderr=b"" (bytes). Since the actual subprocess.run call uses text=True, stderr should be an empty string "" instead of bytes b"".
| def test_bicep_build_no_files(self, mock_glob, mock_run): | ||
| """Test bicep build when no bicep files are found.""" | ||
| mock_glob.return_value = [] | ||
| mock_run.return_value = MagicMock(stdout="Bicep CLI version 0.4.1008", stderr=b"") |
Copilot
AI
Nov 16, 2025
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.
The mock for the version check incorrectly uses stderr=b"" (bytes). Since the actual subprocess.run call uses text=True, stderr should be an empty string "" instead of bytes b"".
|
|
||
| # Mock version and build calls (no upgrade because -noupgrade is hardcoded) | ||
| mock_run.side_effect = [ | ||
| MagicMock(stdout="Bicep CLI version 0.4.1008", stderr=b""), |
Copilot
AI
Nov 16, 2025
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.
The mock for the version check in the side_effect list incorrectly uses stderr=b"" (bytes). Since the actual subprocess.run call uses text=True, stderr should be an empty string "" instead of bytes b"".
|
|
||
| # Mock version and failed build (no upgrade because -noupgrade is hardcoded) | ||
| mock_run.side_effect = [ | ||
| MagicMock(stdout="Bicep CLI version 0.4.1008", stderr=b""), |
Copilot
AI
Nov 16, 2025
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.
The mock for the version check in the side_effect list incorrectly uses stderr=b"" (bytes). Since the actual subprocess.run call uses text=True, stderr should be an empty string "" instead of bytes b"".
|
|
||
| # Mock version and two successful builds (no upgrade because -noupgrade is hardcoded) | ||
| mock_run.side_effect = [ | ||
| MagicMock(stdout="Bicep CLI version 0.4.1008", stderr=b""), |
Copilot
AI
Nov 16, 2025
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.
The mock for the version check in the side_effect list incorrectly uses stderr=b"" (bytes). Since the actual subprocess.run call uses text=True, stderr should be an empty string "" instead of bytes b"".
| #!/usr/bin/env python | ||
| """Unit tests for az_bicep_build function.""" | ||
| import unittest | ||
| import sys |
Copilot
AI
Nov 16, 2025
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.
Import of 'sys' is not used.
| import sys |
| #!/usr/bin/env python | ||
| """Unit tests for az_bicep_format function.""" | ||
| import unittest | ||
| import sys |
Copilot
AI
Nov 16, 2025
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.
Import of 'sys' is not used.
| import sys |



Addressed maintenance tasks: updated dependency versions, added comprehensive test coverage, and corrected typos in project descriptions.
Dependencies Updated
v4.5.0→v5.0.0setup-python:v5.3.0→v5.3.1Tests Added
Created 8 unit tests covering both
az_bicep_buildandaz_bicep_formatfunctions:Tests use mocking to avoid external dependencies and run via standard
unittestdiscovery.Descriptions Fixed
setup.pydescription with specific functionality detailslong_descriptionsourced from README.mdAll changes are backwards compatible and pass security scans.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.