This commit is contained in:
Ken Pepple
2011-08-20 12:43:50 -07:00
parent 0544f5c910
commit fd157386a4

View File

@@ -51,20 +51,20 @@ class InstanceTypeTestCase(test.TestCase):
"""return an instance type name not in the DB"""
nonexistant_flavor = "sdfsfsdf"
flavors = instance_types.get_all_types()
while flavors.has_key(nonexistant_flavor):
nonexistant_flavor = nonexistant_flavor.join("z")
while nonexistant_flavor in flavors:
nonexistant_flavor = nonexistant_flavor.join("z")
else:
return nonexistant_flavor
return nonexistant_flavor
def _nonexistant_flavor_id(self):
"""return an instance type ID not in the DB"""
nonexistant_flavor = 2700
flavor_ids = [ value["id"] for key, value in\
instance_types.get_all_types().iteritems() ]
flavor_ids = [value["id"] for key, value in\
instance_types.get_all_types().iteritems()]
while nonexistant_flavor in flavor_ids:
nonexistant_flavor += 1
nonexistant_flavor += 1
else:
return nonexistant_flavor
return nonexistant_flavor
def _existing_flavor(self):
"""return first instance type name"""