Mock the update tags limits code in unittests
py35 unit tests are failing because of this Change-Id: I534ac78d5f22370bd003ae70a60c295d7fdf5dd1
This commit is contained in:
parent
9ddcaa1a79
commit
8737c1b296
@ -27,6 +27,7 @@ from vmware_nsxlib.v3 import client as nsx_client
|
||||
from vmware_nsxlib.v3 import client_cert
|
||||
from vmware_nsxlib.v3 import cluster as nsx_cluster
|
||||
from vmware_nsxlib.v3 import config
|
||||
from vmware_nsxlib.v3 import utils
|
||||
|
||||
NSX_USER = 'admin'
|
||||
NSX_PASSWORD = 'default'
|
||||
@ -65,6 +66,10 @@ def _mock_nsxlib():
|
||||
'id': uuidutils.generate_uuid()}
|
||||
for rule in rules
|
||||
]}
|
||||
|
||||
def _mock_limits(*args):
|
||||
return utils.TagLimits(20, 40, 15)
|
||||
|
||||
mocking = []
|
||||
mocking.append(mock.patch(
|
||||
"vmware_nsxlib.v3.cluster.NSXRequestsHTTPProvider"
|
||||
@ -95,6 +100,10 @@ def _mock_nsxlib():
|
||||
"NsxLibTransportZone.get_id_by_name_or_id"),
|
||||
return_value=uuidutils.generate_uuid()))
|
||||
|
||||
mocking.append(mock.patch(
|
||||
"vmware_nsxlib.v3.NsxLib.get_tag_limits",
|
||||
side_effect=_mock_limits))
|
||||
|
||||
for m in mocking:
|
||||
m.start()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user