replaced ugly INSTANCE_TYPE constant with (slightly less ugly) stubs

This commit is contained in:
Ken Pepple
2011-02-28 16:28:46 -08:00
parent aa489d433c
commit 4f294a6ba3
2 changed files with 1 additions and 9 deletions

View File

@@ -48,14 +48,6 @@ flags.DEFINE_bool('fake_tests', True,
'should we use everything for testing')
INSTANCE_TYPES = {
'm1.tiny': dict(memory_mb=512, vcpus=1, local_gb=0, flavorid=1),
'm1.small': dict(memory_mb=2048, vcpus=1, local_gb=20, flavorid=2),
'm1.medium': dict(memory_mb=4096, vcpus=2, local_gb=40, flavorid=3),
'm1.large': dict(memory_mb=8192, vcpus=4, local_gb=80, flavorid=4),
'm1.xlarge': dict(memory_mb=16384, vcpus=8, local_gb=160, flavorid=5)}
def skip_if_fake(func):
"""Decorator that skips a test if running in fake mode"""
def _skipper(*args, **kw):

View File

@@ -233,7 +233,7 @@ class XenAPIVMTestCase(test.TestCase):
vm = vms[0]
# Check that m1.large above turned into the right thing.
instance_type = test.INSTANCE_TYPES['m1.large']
instance_type = db.instance_type_get_by_name(conn, 'm1.large')
mem_kib = long(instance_type['memory_mb']) << 10
mem_bytes = str(mem_kib << 10)
vcpus = instance_type['vcpus']