diff options
author | Steven Pisarski <s.pisarski@cablelabs.com> | 2017-07-21 13:34:27 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-07-21 13:34:27 +0000 |
commit | 3e84444f51b9cedc804eb03e4aa9a69cb7a422d9 (patch) | |
tree | d5d4dfc4a5c0086cae723039c011a6f7c285dc59 /snaps/openstack/tests | |
parent | 6c43b694e139efdf77540ac1518c422c5bc2574c (diff) | |
parent | 7d5d0625b881361b946ea059916e203bd81a16fa (diff) |
Merge "Created new class KeypairSettingsError."
Diffstat (limited to 'snaps/openstack/tests')
-rw-r--r-- | snaps/openstack/tests/create_keypairs_tests.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/snaps/openstack/tests/create_keypairs_tests.py b/snaps/openstack/tests/create_keypairs_tests.py index 29fe843..aeeefaf 100644 --- a/snaps/openstack/tests/create_keypairs_tests.py +++ b/snaps/openstack/tests/create_keypairs_tests.py @@ -16,7 +16,8 @@ import unittest import uuid import os -from snaps.openstack.create_keypairs import KeypairSettings, OpenStackKeypair +from snaps.openstack.create_keypairs import ( + KeypairSettings, OpenStackKeypair, KeypairSettingsError) from snaps.openstack.tests.os_source_file_test import OSIntegrationTestCase from snaps.openstack.utils import nova_utils @@ -29,11 +30,11 @@ class KeypairSettingsUnitTests(unittest.TestCase): """ def test_no_params(self): - with self.assertRaises(Exception): + with self.assertRaises(KeypairSettingsError): KeypairSettings() def test_empty_config(self): - with self.assertRaises(Exception): + with self.assertRaises(KeypairSettingsError): KeypairSettings(**dict()) def test_name_only(self): @@ -84,7 +85,7 @@ class KeypairSettingsUnitTests(unittest.TestCase): def test_config_all(self): settings = KeypairSettings( **{'name': 'foo', 'public_filepath': '/foo/bar.pub', - 'private_filepath': '/foo/bar'}) + 'private_filepath': '/foo/bar'}) self.assertEqual('foo', settings.name) self.assertEqual('/foo/bar.pub', settings.public_filepath) self.assertEqual('/foo/bar', settings.private_filepath) |