Skip to content

mock as runtime dependency #4800

@rjschwei

Description

@rjschwei

Hi,

When using

az network public-ip create --resource-group xxx --name yyy

the code attempts to load the Python mock module, this appears to be counter intuitive. At runtime, i.e. when using the tools one would expect that things actually happen rather than actions/responses being mocked. Having a dependency on mock outside of testing appears strange.

File "/usr/lib/python3.4/site-packages/azure/cli/command_modules/network/custom.py", line 8, in
import mock

and in that code:

@mock.patch('msrestazure.azure_operation.AzureOperationPoller._poll', _poll)
def _generate_vpn_profile(....

@mock.patch('msrestazure.azure_operation.AzureOperationPoller._poll', _poll)
def _generatevpnclientpackage(....

@glaubitz please follow this as well

Environment summary

openSUSE Leap 42.3 azure-cli packages

Metadata

Metadata

Assignees

Labels

Networkaz network vnet/lb/nic/dns/etc...

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions