Improve readability of MagicMock use in RYU test
Replaces an unnecessarily complex setup of a magicmock in an RYU test module. Change-Id: If2e99ff76114d896a6480a884a531f901198caa5
This commit is contained in:
parent
e65b06f458
commit
beccd7cda8
|
@ -38,10 +38,7 @@ class RyuSecurityGroupsTestCase(test_sg.SecurityGroupDBTestCase):
|
||||||
def setUp(self, plugin=None):
|
def setUp(self, plugin=None):
|
||||||
test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_HYBRID_DRIVER)
|
test_sg_rpc.set_firewall_driver(test_sg_rpc.FIREWALL_HYBRID_DRIVER)
|
||||||
self.fake_ryu = fake_ryu.patch_fake_ryu_client().start()
|
self.fake_ryu = fake_ryu.patch_fake_ryu_client().start()
|
||||||
notifier_p = mock.patch(NOTIFIER)
|
self.notifier = mock.patch(NOTIFIER).start().return_value
|
||||||
notifier_cls = notifier_p.start()
|
|
||||||
self.notifier = mock.Mock()
|
|
||||||
notifier_cls.return_value = self.notifier
|
|
||||||
self._attribute_map_bk_ = {}
|
self._attribute_map_bk_ = {}
|
||||||
for item in attributes.RESOURCE_ATTRIBUTE_MAP:
|
for item in attributes.RESOURCE_ATTRIBUTE_MAP:
|
||||||
self._attribute_map_bk_[item] = (attributes.
|
self._attribute_map_bk_[item] = (attributes.
|
||||||
|
|
Loading…
Reference in New Issue