Flesh out FakeImage for extra_properties
The FakeImage in test_images_resource.py is missing a lot of standard
properties. That becomes a problem as soon as you add extra_properties,
which gets delegated to for any missing property by ImageTarget. Thus,
if that fixture has extra_properties defined on it, any other base
property (i.e. checksum, size, etc) will be looked for inside that dict
if it is not defined on the fixture itself.
Thus, this adds fake values for all those properties and adds
extra_properties={} so that subsequent patches can put things into
extra_properties without a bunch of work.
Change-Id: I4b63706927b599eb343b614f0c396f699378e14b
(cherry picked from commit 7c91a177ed
)
This commit is contained in:
parent
ec46cbca97
commit
663e027e50
|
@ -140,6 +140,26 @@ class FakeImage(object):
|
||||||
self.disk_format = disk_format
|
self.disk_format = disk_format
|
||||||
self.locations = locations
|
self.locations = locations
|
||||||
self.owner = unit_test_utils.TENANT1
|
self.owner = unit_test_utils.TENANT1
|
||||||
|
self.created_at = ''
|
||||||
|
self.updated_at = ''
|
||||||
|
self.min_disk = ''
|
||||||
|
self.min_ram = ''
|
||||||
|
self.protected = False
|
||||||
|
self.checksum = ''
|
||||||
|
self.os_hash_algo = ''
|
||||||
|
self.os_hash_value = ''
|
||||||
|
self.size = 0
|
||||||
|
self.virtual_size = 0
|
||||||
|
self.visibility = 'public'
|
||||||
|
self.os_hidden = False
|
||||||
|
self.name = 'foo'
|
||||||
|
self.tags = []
|
||||||
|
self.extra_properties = {}
|
||||||
|
|
||||||
|
# NOTE(danms): This fixture looks more like the db object than
|
||||||
|
# the proxy model. This needs fixing all through the tests
|
||||||
|
# below.
|
||||||
|
self.image_id = self.id
|
||||||
|
|
||||||
|
|
||||||
class TestImagesController(base.IsolatedUnitTest):
|
class TestImagesController(base.IsolatedUnitTest):
|
||||||
|
|
Loading…
Reference in New Issue