stop patching RbacNeutronDbObjectMixin
No need to patch neutron.objects.rbac_db.RbacNeutronDbObjectMixin directly as the QoSPolicy OVO can be patched instead to remove the dependency on neutron for the said. This patch does just that. Change-Id: I530694c2fbb6d8394394bb6c889484b086ef7e04
This commit is contained in:
parent
ef81e5b565
commit
b3a6859eb1
@ -94,9 +94,7 @@ class TestQosNsxV3Notification(base.BaseQosTestCase,
|
||||
|
||||
self.nsxlib = v3_utils.get_nsxlib_wrapper()
|
||||
|
||||
@mock.patch(
|
||||
'neutron.objects.rbac_db.RbacNeutronDbObjectMixin'
|
||||
'.create_rbac_policy')
|
||||
@mock.patch.object(QoSPolicy, 'create_rbac_policy')
|
||||
@mock.patch.object(nsx_db, 'add_qos_policy_profile_mapping')
|
||||
def test_policy_create_profile(self, fake_db_add, fake_rbac_create):
|
||||
# test the switch profile creation when a QoS policy is created
|
||||
@ -121,9 +119,7 @@ class TestQosNsxV3Notification(base.BaseQosTestCase,
|
||||
# verify that the policy->profile mapping entry was added
|
||||
self.assertTrue(fake_db_add.called)
|
||||
|
||||
@mock.patch(
|
||||
'neutron.objects.rbac_db.RbacNeutronDbObjectMixin'
|
||||
'.create_rbac_policy')
|
||||
@mock.patch.object(QoSPolicy, 'create_rbac_policy')
|
||||
def __test_policy_update_profile(self, *mocks):
|
||||
# test the switch profile update when a QoS policy is updated
|
||||
fields = base_object.get_updatable_fields(
|
||||
|
@ -280,9 +280,8 @@ class TestQosNsxVNotification(test_plugin.NsxVPluginV2TestCase,
|
||||
with mock.patch('neutron.services.qos.qos_plugin.QoSPlugin.'
|
||||
'get_policy',
|
||||
return_value=_policy) as rules_mock,\
|
||||
mock.patch('neutron.objects.qos.policy.'
|
||||
'QosPolicy.get_object',
|
||||
return_value=_policy),\
|
||||
mock.patch.object(QosPolicy, 'get_object',
|
||||
return_value=_policy),\
|
||||
mock.patch.object(self.ctxt.session, 'expunge'):
|
||||
# create the network to use this policy
|
||||
net = self._create_net()
|
||||
|
Loading…
x
Reference in New Issue
Block a user