Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
0c7c370b
Commit
0c7c370b
authored
Jun 17, 2013
by
Christos Stavrakakis
Browse files
cyclades: Sync API tests with latest API changes
parent
df790bc6
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/api/test/images.py
View file @
0c7c370b
...
...
@@ -130,12 +130,14 @@ class ImageAPITest(ComputeAPITest):
'created'
:
'2012-11-26T11:52:54+00:00'
,
'updated'
:
'2012-12-26T11:52:54+00:00'
,
'user_id'
:
'user1'
,
'tenant_id'
:
'user1'
,
'metadata'
:
{
'foo'
:
'bar'
}},
{
'id'
:
2
,
'name'
:
'image-2'
,
'status'
:
'DELETED'
,
'progress'
:
0
,
'user_id'
:
'user1'
,
'tenant_id'
:
'user1'
,
'created'
:
'2012-11-26T11:52:54+00:00'
,
'updated'
:
'2012-12-26T11:52:54+00:00'
,
'metadata'
:
{}},
...
...
@@ -144,6 +146,7 @@ class ImageAPITest(ComputeAPITest):
'status'
:
'ACTIVE'
,
'progress'
:
100
,
'user_id'
:
'user1'
,
'tenant_id'
:
'user1'
,
'created'
:
'2012-11-26T11:52:54+00:00'
,
'updated'
:
'2012-12-26T11:52:54+00:00'
,
'metadata'
:
{}}]
...
...
@@ -152,6 +155,7 @@ class ImageAPITest(ComputeAPITest):
self
.
assertSuccess
(
response
)
api_images
=
json
.
loads
(
response
.
content
)[
'images'
]
self
.
assertEqual
(
len
(
result_images
),
len
(
api_images
))
map
(
lambda
image
:
image
.
pop
(
"links"
),
api_images
)
self
.
assertEqual
(
result_images
,
api_images
)
@
assert_backend_closed
...
...
@@ -205,11 +209,13 @@ class ImageAPITest(ComputeAPITest):
'created'
:
'2012-11-26T11:52:54+00:00'
,
'updated'
:
'2012-12-26T11:52:54+00:00'
,
'user_id'
:
'user1'
,
'tenant_id'
:
'user1'
,
'metadata'
:
{
'foo'
:
'bar'
}}
mimage
.
return_value
.
get_image
.
return_value
=
image
response
=
self
.
myget
(
'images/42'
,
'user'
)
self
.
assertSuccess
(
response
)
api_image
=
json
.
loads
(
response
.
content
)[
'image'
]
api_image
.
pop
(
"links"
)
self
.
assertEqual
(
api_image
,
result_image
)
@
assert_backend_closed
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment