{Compute} Fix mock logic for test_read_images_from_alias_doc#19843
{Compute} Fix mock logic for test_read_images_from_alias_doc#19843zhoxing-ms merged 1 commit intoAzure:devfrom
test_read_images_from_alias_doc#19843Conversation
There was a problem hiding this comment.
Please remember to rename the parameter mock_urlopen accordingly.
|
I haven't looked into it in detail, but |
Good question! Previously, the purpose of this mock was to mock the querying results of However, since there was a new PR #10852 to add the logic of reading local json dict when remote files cannot be accessed to the method except requests.exceptions.ConnectionError:
logger.warning("Failed to retrieve image alias doc '%s'. Error: 'ConnectionError'. Use local copy instead.",
target_url)
dic = json.loads(alias_json)Since the logic of querying |
0da28f9 to
3b80270
Compare
test_read_images_from_alias_doctest_read_images_from_alias_doc
Description
Because in the previous PR #5328, the reference of

urlopenin the methodload_images_from_aliases_doc()was modified to userequests, but the mock path intest_read_images_from_alias_doc()was not synchronously modified.code link
So we need to change the mock path
azure.cli.command_modules.vm.custom.urlopentoazure.cli.command_modules.vm.custom.requestsTesting Guide
History Notes
[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.