diff options
author | Soren Hansen <soren@linux2go.dk> | 2011-08-05 15:37:36 +0200 |
---|---|---|
committer | Soren Hansen <soren@linux2go.dk> | 2011-08-05 15:37:36 +0200 |
commit | 1e366d9de180347b47675bf7f811ffd5a293ef10 (patch) | |
tree | aea0c70050c7ebc2096096009d1f277ba82bb513 /nova | |
parent | 9742ff588d3ce90b1420eaf95e311f02a4e196da (diff) | |
download | nova-1e366d9de180347b47675bf7f811ffd5a293ef10.tar.gz nova-1e366d9de180347b47675bf7f811ffd5a293ef10.tar.xz nova-1e366d9de180347b47675bf7f811ffd5a293ef10.zip |
pep8
Diffstat (limited to 'nova')
-rw-r--r-- | nova/image/fake.py | 2 | ||||
-rw-r--r-- | nova/tests/test_image.py | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/nova/image/fake.py b/nova/image/fake.py index b29ec6517..97af81711 100644 --- a/nova/image/fake.py +++ b/nova/image/fake.py @@ -118,7 +118,7 @@ class _FakeImageService(service.BaseImageService): """Returns list of images.""" retval = [] for img in self.images.values(): - retval += [dict([(k, v) for k, v in img.iteritems() + retval += [dict([(k, v) for k, v in img.iteritems() if k in ['id', 'name']])] return retval diff --git a/nova/tests/test_image.py b/nova/tests/test_image.py index ba5b93f9b..5ec8812f3 100644 --- a/nova/tests/test_image.py +++ b/nova/tests/test_image.py @@ -1,6 +1,6 @@ # vim: tabstop=4 shiftwidth=4 softtabstop=4 -# Copyright 2011 Linux2Go +# Copyright 2011 OpenStack LLC # Author: Soren Hansen # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -82,16 +82,14 @@ class _ImageTestCase(test.TestCase): self.image_service.create(self.context, {}) index = self.image_service.index(self.context) - self.assertEquals(len(index), image_count+1) + self.assertEquals(len(index), image_count + 1) self.assertTrue(index[0]['id']) - def test_create_keeps_id(self): self.image_service.create(self.context, {'id': '34'}) self.image_service.show(self.context, '34') - def test_create_rejects_duplicate_ids(self): self.image_service.create(self.context, {'id': '34'}) self.assertRaises(exception.Duplicate, @@ -132,4 +130,3 @@ class FakeImageTestCase(_ImageTestCase): def setUp(self): super(FakeImageTestCase, self).setUp() self.image_service = nova.image.fake.FakeImageService() - |