package verify plugin ci tests fixes#4700
Draft
vaibhavdaren wants to merge 2 commits intovaibhav-package-verify-pluginfrom
Draft
package verify plugin ci tests fixes#4700vaibhavdaren wants to merge 2 commits intovaibhav-package-verify-pluginfrom
vaibhavdaren wants to merge 2 commits intovaibhav-package-verify-pluginfrom
Conversation
The three TestJiraLink tests were making real network requests to https://issues.redhat.com/rest/api/2/serverInfo because the jira.JIRA() constructor validates the connection on init. Only add_simple_link was mocked, so the constructor hit the live server and failed with 503. Fix by mocking the entire jira.JIRA class instead of only add_simple_link. This prevents the constructor from making any network call and fully isolates the tests from the network. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move the repeated @patch decorators from each test method to the class level. All three tests share the same two mocks, so applying them once at the class level reduces duplication and makes it easier to add new tests in the future. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the Jira link tests in tests/unit/test_utils.py. Common mock patches for jira.JIRA and tmt.config.Config.fmf_tree have been moved from individual test methods to the TestJiraLink class level to reduce code duplication. The test methods have been updated to work with the class-level mocks. No issues were found during the review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Check Tests are working,
Note: Will close this once #4699 is merged. Will Rebase the plugin PR on top of it.