8
8
class SecurityGroupTestCase(TXAWSTestCase):
10
10
def test_creation_defaults(self):
11
group = model.SecurityGroup("sg-a3f2", "name", "desc")
12
self.assertEquals(group.id, "sg-a3f2")
11
group = model.SecurityGroup("name", "desc")
13
12
self.assertEquals(group.name, "name")
14
13
self.assertEquals(group.description, "desc")
15
14
self.assertEquals(group.owner_id, "")
19
18
def test_creation_all_parameters(self):
22
model.SecurityGroup("sg-other1", "other1", "another group 1"),
23
model.SecurityGroup("sg-other2", "other2", "another group 2")]
21
model.SecurityGroup("other1", "another group 1"),
22
model.SecurityGroup("other2", "another group 2")]
24
23
user_group_pairs = [
25
24
model.UserIDGroupPair(user, other_groups[0].name),
26
25
model.UserIDGroupPair(user, other_groups[1].name)]
27
26
ips = [model.IPPermission("tcp", "80", "80", "10.0.1.0/24")]
28
27
group = model.SecurityGroup(
29
"id", "name", "desc", owner_id="me", groups=user_group_pairs, ips=ips)
30
self.assertEquals(group.id, "id")
28
"name", "desc", owner_id="me", groups=user_group_pairs, ips=ips)
31
29
self.assertEquals(group.name, "name")
32
30
self.assertEquals(group.description, "desc")
33
31
self.assertEquals(group.owner_id, "me")