def test_security_groups(self): server = Server.start('kirit', ('security_group', 'web'), ('security_group', 'ssh')) self.assertItemsEqual([g.id for g in server.instance.groups], ['web', 'ssh'])
def test_start_basic(self): server = Server.start('test') self.assertEquals(str(server), u"ec2-host -- running (host) [default] {}")
def test_start_customise_bits(self): server = Server.start("test", ("size", "t1.micro"), ("bits", "64")) self.assertEqual(server.instance.instance_type, "t1.micro") self.assertEqual(server.instance.image_id, "ami-63be790a")
def test_start_customise_bits(self): server = Server.start('test', ('size', 't1.micro'), ('bits', '64'), ('ami.precise', None)) self.assertEqual(server.instance.instance_type, 't1.micro') self.assertEqual(server.instance.image_id, 'ami-f8d4f9ef')
def test_start_customise_bits(self): server = Server.start('test', ('size', 't1.micro'), ('bits', '64')) self.assertEqual(server.instance.instance_type, 't1.micro') self.assertEqual(server.instance.image_id, 'ami-1e6f6176')
def test_start_with_size(self): server = Server.start("test", ("size", "c1.xlarge")) self.assertEqual(server.instance.instance_type, "c1.xlarge")
def test_start_with_roles(self): server = Server.start("test", "postgres", "smarthost") self.assertEquals(str(server), u"ec2-host -- running (host) [default] {}")
def test_start_with_region(self): server = Server.start('test', ('region', 'bangkok'), ('ami', 'test-ami')) self.assertEqual(server.instance.region.name, 'bangkok') self.assertEqual(server.instance.image_id, 'test-ami')
def test_start_oneiric(self): server = Server.start("test", "ami.oneiric") self.assertEqual(server.instance.image_id, "ami-0bcb0262")
def test_security_groups(self): server = Server.start("kirit", ("security_group", "web"), ("security_group", "ssh")) self.assertItemsEqual([g.id for g in server.instance.groups], ["web", "ssh"])
def test_start_natty(self): server = Server.start("test", "ami.natty") self.assertEqual(server.instance.image_id, "ami-639b530a")
def test_start_lucid(self): server = Server.start("test", "ami.lucid") self.assertEqual(server.instance.image_id, "ami-2cc83145")
def test_start_lucid(self): server = Server.start('test', 'ami.lucid') self.assertEqual(server.instance.image_id, 'ami-1c6f6174')
def test_start_with_roles(self): server = Server.start('test', 'postgres', 'smarthost') self.assertEquals(str(server), u"ec2-host -- running (host) [default] {}")
def test_start_with_ami(self): server = Server.start("test", ("ami", "test-ami")) self.assertEqual(server.instance.image_id, "test-ami")
def test_start_with_ami(self): server = Server.start('test', ('ami', 'test-ami')) self.assertEqual(server.instance.image_id, 'test-ami')
def test_start_with_region(self): server = Server.start("test", ("region", "bangkok"), ("ami", "test-ami")) self.assertEqual(server.instance.region.name, "bangkok") self.assertEqual(server.instance.image_id, "test-ami")
def test_start_with_size(self): server = Server.start('test', ('size', 'c1.xlarge')) self.assertEqual(server.instance.instance_type, 'c1.xlarge')
def test_create(self): server = Server.start('test-volume') volume = Volume.create(server, 2) self.assertTrue(volume.attached)