summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/tests/create_security_group_tests.py
diff options
context:
space:
mode:
authorSteven Pisarski <s.pisarski@cablelabs.com>2017-07-24 15:10:18 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-07-24 15:10:18 +0000
commitc613a9a564035e97da15152789371d9d9ae6041d (patch)
tree7af6938533d8f9646b013353aa2971e443a939fb /snaps/openstack/tests/create_security_group_tests.py
parenta2b4763d5fe13bfe47de0d44e7d7c519f1084215 (diff)
parent0a5181d00709e029c317aeb90c75e9cd4fa7d130 (diff)
Merge "Created new exceptions for security group settings"
Diffstat (limited to 'snaps/openstack/tests/create_security_group_tests.py')
-rw-r--r--snaps/openstack/tests/create_security_group_tests.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/snaps/openstack/tests/create_security_group_tests.py b/snaps/openstack/tests/create_security_group_tests.py
index 75c6387..dd28d7d 100644
--- a/snaps/openstack/tests/create_security_group_tests.py
+++ b/snaps/openstack/tests/create_security_group_tests.py
@@ -19,7 +19,9 @@ from snaps.openstack import create_security_group
from snaps.openstack.create_security_group import (SecurityGroupSettings,
SecurityGroupRuleSettings,
Direction, Ethertype,
- Protocol)
+ Protocol,
+ SecurityGroupRuleSettingsError,
+ SecurityGroupSettingsError)
from snaps.openstack.tests import validation_utils
from snaps.openstack.tests.os_source_file_test import OSIntegrationTestCase
from snaps.openstack.utils import neutron_utils
@@ -33,19 +35,19 @@ class SecurityGroupRuleSettingsUnitTests(unittest.TestCase):
"""
def test_no_params(self):
- with self.assertRaises(Exception):
+ with self.assertRaises(SecurityGroupRuleSettingsError):
SecurityGroupRuleSettings()
def test_empty_config(self):
- with self.assertRaises(Exception):
+ with self.assertRaises(SecurityGroupRuleSettingsError):
SecurityGroupRuleSettings(**dict())
def test_name_only(self):
- with self.assertRaises(Exception):
+ with self.assertRaises(SecurityGroupRuleSettingsError):
SecurityGroupRuleSettings(sec_grp_name='foo')
def test_config_with_name_only(self):
- with self.assertRaises(Exception):
+ with self.assertRaises(SecurityGroupRuleSettingsError):
SecurityGroupRuleSettings(**{'sec_grp_name': 'foo'})
def test_name_and_direction(self):
@@ -105,11 +107,11 @@ class SecurityGroupSettingsUnitTests(unittest.TestCase):
"""
def test_no_params(self):
- with self.assertRaises(Exception):
+ with self.assertRaises(SecurityGroupSettingsError):
SecurityGroupSettings()
def test_empty_config(self):
- with self.assertRaises(Exception):
+ with self.assertRaises(SecurityGroupSettingsError):
SecurityGroupSettings(**dict())
def test_name_only(self):
@@ -123,7 +125,7 @@ class SecurityGroupSettingsUnitTests(unittest.TestCase):
def test_invalid_rule(self):
rule_setting = SecurityGroupRuleSettings(sec_grp_name='bar',
direction=Direction.ingress)
- with self.assertRaises(Exception):
+ with self.assertRaises(SecurityGroupSettingsError):
SecurityGroupSettings(name='foo', rule_settings=[rule_setting])
def test_all(self):