Unit tests: Fix slow Manila test

We were retrying the create due to the client_plugin being mocked out,
which resulted in the test taking >60s instead of ~0.3s.

Change-Id: I14d0a88b94f7e56e03683021c9c29a55dac9e516
Story: #1745010
Task: 23347
This commit is contained in:
Zane Bitter 2018-07-31 11:42:29 -04:00
parent e63778efc9
commit 20c53bb03d
1 changed files with 7 additions and 2 deletions

View File

@ -152,11 +152,16 @@ class ManilaShareNetworkTest(common.HeatTestCase):
self.assertEqual('share_networks', net.entity)
def test_create_fail(self):
self.client.share_networks.add_security_service.side_effect = (
Exception())
self.client_plugin.is_conflict.return_value = False
self.client.share_networks.add_security_service.side_effect = Exception
self.assertRaises(
exception.ResourceFailure,
self._create_network, 'share_network', self.rsrc_defn, self.stack)
csn = self.client.share_networks
csn.create.assert_called_with(
name='1', description='2', neutron_net_id='3',
neutron_subnet_id='4', nova_net_id=None)
csn.add_security_service.assert_called_once_with('42', '6')
def test_validate_conflicting_net_subnet(self):
t = template_format.parse(stack_template)