Revision 028f4731 snf-cyclades-app/synnefo/plankton/tests.py
b/snf-cyclades-app/synnefo/plankton/tests.py | ||
---|---|---|
93 | 93 |
'location': u'pithos://foo@example.com/container/foo3', |
94 | 94 |
u'name': u'dummyname', |
95 | 95 |
'owner': u'foo@example.com', |
96 |
'properties': {}, |
|
97 | 96 |
'size': 500L, |
98 | 97 |
u'status': u'available', |
99 | 98 |
'store': 'pithos', |
... | ... | |
110 | 109 |
'location': u'pithos://foo@example.com/container/private', |
111 | 110 |
u'name': u'dummyname2', |
112 | 111 |
'owner': u'foo@example.com', |
113 |
'properties': {}, |
|
114 | 112 |
'size': 10000L, |
115 | 113 |
u'status': u'available', |
116 | 114 |
'store': 'pithos', |
... | ... | |
125 | 123 |
'id': u'264fb9ac-2458-421c-b460-6a765a92825c', |
126 | 124 |
'is_public': True, |
127 | 125 |
'location': u'pithos://foo@example.com/container/baz.diskdump', |
128 |
u'name': u'"dummyname3"',
|
|
126 |
'name': u'"dummyname3"', |
|
129 | 127 |
'owner': u'foo@example.com', |
130 |
'properties': {u'description': u'Debian Squeeze Base System',
|
|
131 |
u'gui': u'No GUI',
|
|
132 |
u'kernel': u'2.6.32',
|
|
133 |
u'os': u'debian',
|
|
134 |
u'osfamily': u'linux',
|
|
135 |
u'root_partition': u'1',
|
|
136 |
u'size': u'451',
|
|
137 |
u'sortorder': u'1',
|
|
138 |
u'users': u'root'},
|
|
128 |
'property_description': u'Debian Squeeze Base System',
|
|
129 |
'property_gui': u'No GUI',
|
|
130 |
'property_kernel': u'2.6.32',
|
|
131 |
'property_os': u'debian',
|
|
132 |
'property_osfamily': u'linux',
|
|
133 |
'property_root_partition': u'1',
|
|
134 |
'property_size': u'451',
|
|
135 |
'property_sortorder': u'1',
|
|
136 |
'property_users': u'root',
|
|
139 | 137 |
'size': 473772032L, |
140 | 138 |
u'status': u'available', |
141 | 139 |
'store': 'pithos', |
... | ... | |
180 | 178 |
images = json.loads(response.content) |
181 | 179 |
for api_image in images: |
182 | 180 |
id = api_image['id'] |
183 |
pithos_image = dict([(key, val)\ |
|
184 |
for key, val in DummyImages[id].items()\ |
|
185 |
if key in DETAIL_FIELDS]) |
|
181 |
pithos_image = {} |
|
182 |
properties = {} |
|
183 |
for key, val in DummyImages[id].items(): |
|
184 |
if key.startswith('property_'): |
|
185 |
properties[key.replace('property_', '', 1)] = val |
|
186 |
elif key in DETAIL_FIELDS: |
|
187 |
pithos_image[key] = val |
|
188 |
if properties: |
|
189 |
pithos_image['properties'] = properties |
|
186 | 190 |
self.assertEqual(api_image, pithos_image) |
191 |
|
|
187 | 192 |
backend.return_value\ |
188 | 193 |
.list_images.assert_called_once_with({}, {'sort_key': 'created_at', |
189 | 194 |
'sort_dir': 'desc'}) |
Also available in: Unified diff