Don't set multiple images if image_ref_alt is the same as image_ref. Fix typo

in skip_unless_addr.

Change-Id: Ib106fc4a8ac895f44c903aa3ba6f66765bd5f121
This commit is contained in:
David Kranz 2012-01-19 10:10:05 -05:00
parent 0779dfd306
commit d3bb405282
2 changed files with 5 additions and 8 deletions

View File

@ -25,18 +25,15 @@ class ServerDetailsTest(unittest.TestCase):
images_client = cls.os.images_client
resp, images = images_client.list_images()
if any([image for image in images
if image['id'] == cls.image_ref_alt]):
if cls.image_ref != cls.image_ref_alt and \
any([image for image in images
if image['id'] == cls.image_ref_alt]):
cls.multiple_images = True
else:
cls.image_ref_alt = cls.image_ref
# Do some sanity checks here. If one of the images does
# not exist, or image_ref and image_ref_alt are the same,
# fail early since the tests won't work...
if cls.image_ref != cls.image_ref_alt:
cls.image_ref_alt_different = True
# not exist, fail early since the tests won't work...
try:
cls.images_client.get_image(cls.image_ref)
except exceptions.NotFound:

View File

@ -62,7 +62,7 @@ class skip_unless_attr(object):
"or False") % attr
def __call__(self, func):
def _skipper(*args, **kwargs):
def _skipper(*args, **kw):
"""Wrapped skipper function."""
testobj = args[0]
if not getattr(testobj, self.attr, False):