|
16 | 16 |
|
17 | 17 | import unittest |
18 | 18 |
|
19 | | -from qingcloud.iaas.errors import SecurityGroupRuleError |
| 19 | +from qingcloud.iaas.errors import InvalidSecurityGroupRule |
20 | 20 | from qingcloud.iaas.sg_rule import SecurityGroupRuleFactory, _RuleForTCP, _RuleForGRE |
21 | 21 |
|
22 | 22 | class SecurityGroupRuleFactoryTestCase(unittest.TestCase): |
@@ -78,14 +78,14 @@ def test_rule_with_existing_id(self): |
78 | 78 | self.assertEqual(json_data['security_group_rule_id'], 'fakeid') |
79 | 79 |
|
80 | 80 | def test_unsupported_protocol(self): |
81 | | - self.assertRaises(SecurityGroupRuleError, SecurityGroupRuleFactory.create, 'unsupported', 0) |
| 81 | + self.assertRaises(InvalidSecurityGroupRule, SecurityGroupRuleFactory.create, 'unsupported', 0) |
82 | 82 |
|
83 | 83 | def test_invalid_priority(self): |
84 | | - self.assertRaises(SecurityGroupRuleError, SecurityGroupRuleFactory.create, |
| 84 | + self.assertRaises(InvalidSecurityGroupRule, SecurityGroupRuleFactory.create, |
85 | 85 | SecurityGroupRuleFactory.PROTOCOL_UDP, -1) |
86 | | - self.assertRaises(SecurityGroupRuleError, SecurityGroupRuleFactory.create, |
| 86 | + self.assertRaises(InvalidSecurityGroupRule, SecurityGroupRuleFactory.create, |
87 | 87 | SecurityGroupRuleFactory.PROTOCOL_UDP, 101) |
88 | | - self.assertRaises(SecurityGroupRuleError, SecurityGroupRuleFactory.create, |
| 88 | + self.assertRaises(InvalidSecurityGroupRule, SecurityGroupRuleFactory.create, |
89 | 89 | SecurityGroupRuleFactory.PROTOCOL_UDP, '10') |
90 | 90 |
|
91 | 91 | rule = SecurityGroupRuleFactory.create(SecurityGroupRuleFactory.PROTOCOL_UDP, 0) |
|
0 commit comments