diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-04-21 12:52:29 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-04-23 20:20:03 +0200 |
commit | fd18d52e94cc293c32bb7f69a00ec4604bdace0e (patch) | |
tree | 0efbd8d2721459982ac1144dbe93ee91053f744f /functest/tests/unit/openstack/vping | |
parent | 8813a7d33fc632cdbeaa7cfd126976e6a57c68ea (diff) |
Switch from deploy utils to the right objects
It also prints the full exceptions and removes useless casts.
Change-Id: I19ff1ae90670833f998c0d17592da82207235229
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests/unit/openstack/vping')
-rw-r--r-- | functest/tests/unit/openstack/vping/test_vping.py | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/functest/tests/unit/openstack/vping/test_vping.py b/functest/tests/unit/openstack/vping/test_vping.py index 3aaa4594a..adc0f69a6 100644 --- a/functest/tests/unit/openstack/vping/test_vping.py +++ b/functest/tests/unit/openstack/vping/test_vping.py @@ -60,14 +60,16 @@ class VPingUserdataTesting(unittest.TestCase): 'get_ext_net_name', return_value='foo') def test_vping_userdata(self, *args): # pylint: disable=unused-argument - with mock.patch('snaps.openstack.utils.deploy_utils.create_image', + with mock.patch('snaps.openstack.create_image.OpenStackImage.create', return_value=OpenStackImage(self.os_creds, None)), \ - mock.patch('snaps.openstack.utils.deploy_utils.create_network', - return_value=OpenStackNetwork( - self.os_creds, NetworkConfig(name='foo'))), \ - mock.patch('snaps.openstack.utils.deploy_utils.create_router', - return_value=OpenStackRouter( - self.os_creds, RouterConfig(name='foo'))), \ + mock.patch( + 'snaps.openstack.create_network.OpenStackNetwork.create', + return_value=OpenStackNetwork( + self.os_creds, NetworkConfig(name='foo'))), \ + mock.patch( + 'snaps.openstack.create_router.OpenStackRouter.create', + return_value=OpenStackRouter( + self.os_creds, RouterConfig(name='foo'))), \ mock.patch('snaps.openstack.utils.deploy_utils.' 'create_vm_instance', return_value=OpenStackVmInstance( @@ -133,14 +135,15 @@ class VPingSSHTesting(unittest.TestCase): cidr='10.0.0.1/24', dns_nameservers=[env.get('NAMESERVER')]) - with mock.patch('snaps.openstack.utils.deploy_utils.create_image', + with mock.patch('snaps.openstack.create_image.OpenStackImage.create', return_value=OpenStackImage(self.os_creds, None)), \ - mock.patch('snaps.openstack.utils.deploy_utils.create_network', - return_value=OpenStackNetwork( - self.os_creds, - NetworkConfig( - name='foo', - subnet_settings=[subnet_config]))), \ + mock.patch( + 'snaps.openstack.create_network.OpenStackNetwork.create', + return_value=OpenStackNetwork( + self.os_creds, + NetworkConfig( + name='foo', + subnet_settings=[subnet_config]))), \ mock.patch('snaps.openstack.utils.deploy_utils.' 'create_vm_instance', return_value=OpenStackVmInstance( @@ -153,9 +156,10 @@ class VPingSSHTesting(unittest.TestCase): mock.patch('snaps.openstack.utils.deploy_utils.create_keypair', return_value=OpenStackKeypair( self.os_creds, KeypairConfig(name='foo'))), \ - mock.patch('snaps.openstack.utils.deploy_utils.create_router', - return_value=OpenStackRouter( - self.os_creds, RouterConfig(name='foo'))), \ + mock.patch( + 'snaps.openstack.create_router.OpenStackRouter.create', + return_value=OpenStackRouter( + self.os_creds, RouterConfig(name='foo'))), \ mock.patch('snaps.openstack.utils.deploy_utils.' 'create_security_group', return_value=OpenStackSecurityGroup( |