Simplified test cases
This commit is contained in:
		| @@ -380,16 +380,8 @@ class ApiEc2TestCase(test.TestCase): | |||||||
|         # dashes, and underscores. |         # dashes, and underscores. | ||||||
|         security_group_name = "aa #^% -=99" |         security_group_name = "aa #^% -=99" | ||||||
|  |  | ||||||
|         try: |         self.assertRaises(EC2ResponseError, self.ec2.create_security_group, | ||||||
|             self.ec2.create_security_group(security_group_name, 'test group') |                           security_group_name, 'test group') | ||||||
|         except EC2ResponseError, e: |  | ||||||
|             if e.code == 'InvalidParameterValue': |  | ||||||
|                 pass |  | ||||||
|             else: |  | ||||||
|                 self.fail("Unexpected EC2ResponseError: %s " |  | ||||||
|                           "(expected InvalidParameterValue)" % e.code) |  | ||||||
|         else: |  | ||||||
|             self.fail('Exception not raised.') |  | ||||||
|  |  | ||||||
|     def test_group_name_valid_length_security_group(self): |     def test_group_name_valid_length_security_group(self): | ||||||
|         """Test that we sanely handle invalid security group names. |         """Test that we sanely handle invalid security group names. | ||||||
| @@ -406,16 +398,9 @@ class ApiEc2TestCase(test.TestCase): | |||||||
|         # Test block group_name > 255 chars |         # Test block group_name > 255 chars | ||||||
|         security_group_name = "".join(random.choice("poiuytrewqasdfghjklmnbvc") |         security_group_name = "".join(random.choice("poiuytrewqasdfghjklmnbvc") | ||||||
|                                       for x in range(random.randint(256, 266))) |                                       for x in range(random.randint(256, 266))) | ||||||
|         try: |  | ||||||
|             self.ec2.create_security_group(security_group_name, 'test group') |         self.assertRaises(EC2ResponseError, self.ec2.create_security_group, | ||||||
|         except EC2ResponseError, e: |                           security_group_name, 'test group') | ||||||
|             if e.code == 'InvalidParameterValue': |  | ||||||
|                 pass |  | ||||||
|             else: |  | ||||||
|                 self.fail("Unexpected EC2ResponseError: %s " |  | ||||||
|                           "(expected InvalidParameterValue)" % e.code) |  | ||||||
|         else: |  | ||||||
|             self.fail('Exception not raised.') |  | ||||||
|  |  | ||||||
|     def test_authorize_revoke_security_group_cidr(self): |     def test_authorize_revoke_security_group_cidr(self): | ||||||
|         """ |         """ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Dave Walker (Daviey)
					Dave Walker (Daviey)