Revision 936e0be3 snf-cyclades-app/synnefo/api/test/images.py
b/snf-cyclades-app/synnefo/api/test/images.py | ||
---|---|---|
103 | 103 |
'status':'available', |
104 | 104 |
'created_at': '2012-11-26 11:52:54', |
105 | 105 |
'updated_at': '2012-12-26 11:52:54', |
106 |
'owner': 'user1', |
|
106 | 107 |
'deleted_at': '', |
107 | 108 |
'properties': {'foo':'bar'}}, |
108 | 109 |
{'id': 2, |
... | ... | |
110 | 111 |
'status': 'deleted', |
111 | 112 |
'created_at': '2012-11-26 11:52:54', |
112 | 113 |
'updated_at': '2012-12-26 11:52:54', |
114 |
'owner': 'user1', |
|
113 | 115 |
'deleted_at': '2012-12-27 11:52:54', |
114 | 116 |
'properties': ''}, |
115 | 117 |
{'id': 3, |
... | ... | |
118 | 120 |
'created_at': '2012-11-26 11:52:54', |
119 | 121 |
'deleted_at': '', |
120 | 122 |
'updated_at': '2012-12-26 11:52:54', |
123 |
'owner': 'user1', |
|
121 | 124 |
'properties': ''}] |
122 | 125 |
result_images = [ |
123 | 126 |
{'id': 1, |
... | ... | |
126 | 129 |
'progress': 100, |
127 | 130 |
'created': '2012-11-26T11:52:54+00:00', |
128 | 131 |
'updated': '2012-12-26T11:52:54+00:00', |
132 |
'user_id': 'user1', |
|
129 | 133 |
'metadata': {'foo':'bar'}}, |
130 | 134 |
{'id': 2, |
131 | 135 |
'name': 'image-2', |
132 | 136 |
'status': 'DELETED', |
133 | 137 |
'progress': 0, |
138 |
'user_id': 'user1', |
|
134 | 139 |
'created': '2012-11-26T11:52:54+00:00', |
135 |
'updated': '2012-12-26T11:52:54+00:00'}, |
|
140 |
'updated': '2012-12-26T11:52:54+00:00', |
|
141 |
'metadata': {}}, |
|
136 | 142 |
{'id': 3, |
137 | 143 |
'name': 'image-3', |
138 | 144 |
'status': 'ACTIVE', |
139 | 145 |
'progress': 100, |
146 |
'user_id': 'user1', |
|
140 | 147 |
'created': '2012-11-26T11:52:54+00:00', |
141 |
'updated': '2012-12-26T11:52:54+00:00'}] |
|
148 |
'updated': '2012-12-26T11:52:54+00:00', |
|
149 |
'metadata': {}}] |
|
142 | 150 |
mimage().list_images.return_value = images |
143 | 151 |
response = self.myget('images/detail', 'user') |
144 | 152 |
self.assertSuccess(response) |
... | ... | |
161 | 169 |
'created_at': old_time.isoformat(), |
162 | 170 |
'deleted_at': '', |
163 | 171 |
'updated_at': old_time.isoformat(), |
172 |
'owner': 'user1', |
|
164 | 173 |
'properties': ''}, |
165 | 174 |
{'id': 2, |
166 | 175 |
'name': 'image-2', |
167 | 176 |
'status': 'deleted', |
168 | 177 |
'progress': 0, |
178 |
'owner': 'user2', |
|
169 | 179 |
'created_at': new_time.isoformat(), |
170 | 180 |
'updated_at': new_time.isoformat(), |
171 | 181 |
'deleted_at': new_time.isoformat(), |
... | ... | |
185 | 195 |
'created_at': '2012-11-26 11:52:54', |
186 | 196 |
'updated_at': '2012-12-26 11:52:54', |
187 | 197 |
'deleted_at': '', |
198 |
'owner': 'user1', |
|
188 | 199 |
'properties': {'foo': 'bar'}} |
189 | 200 |
result_image = \ |
190 | 201 |
{'id': 42, |
... | ... | |
193 | 204 |
'progress': 100, |
194 | 205 |
'created': '2012-11-26T11:52:54+00:00', |
195 | 206 |
'updated': '2012-12-26T11:52:54+00:00', |
207 |
'user_id': 'user1', |
|
196 | 208 |
'metadata': {'foo': 'bar'}} |
197 | 209 |
mimage.return_value.get_image.return_value = image |
198 | 210 |
response = self.myget('images/42', 'user') |
Also available in: Unified diff