def testSuccess(self): get_response = { 'InstanceTypes': { 'InstanceType': [ {'InstanceTypeId': 't1', 'CpuCoreCount': '2', 'MemorySize': '4'}, {'InstanceTypeId': 't2', 'CpuCoreCount': '4', 'MemorySize': '4'} ] } } expected_result = [ecs.InstanceType('t1', 2, 4), ecs.InstanceType('t2', 4, 4)] self.conn.get({'Action': 'DescribeInstanceTypes'}).AndReturn( get_response) self.mox.ReplayAll() self.assertEqual(expected_result, self.conn.describe_instance_types()) self.mox.VerifyAll()
def testRepr(self): t1 = ecs.InstanceType('t1', 4, 2) self.assertTrue(repr(t1).startswith(u'<InstanceType t1'))
def testNotEqual(self): t1 = ecs.InstanceType('t1', 4, 2) t2 = ecs.InstanceType('t1', 4, 3) self.assertNotEqual(t1, t2)