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
kamaki
Commits
8b2d63a7
Commit
8b2d63a7
authored
Jun 26, 2013
by
Stavros Sachtouris
Browse files
Fix broken unittests concerning floating ips
parent
93a4d595
Changes
1
Hide whitespace changes
Inline
Side-by-side
kamaki/clients/cyclades/test.py
View file @
8b2d63a7
...
...
@@ -545,7 +545,7 @@ class CycladesClient(TestCase):
self
.
assertEqual
(
delete
.
mock_calls
[
-
1
],
call
(
fip
))
@
patch
(
'%s.servers_post'
%
cyclades_pkg
,
return_value
=
FR
())
def
test_a
ssoc
_floating_ip
_to_server
(
self
,
spost
):
def
test_a
ttach
_floating_ip
(
self
,
spost
):
vmid
,
addr
=
42
,
'anIpAddress'
for
err
,
args
in
{
ValueError
:
[
'not a server id'
,
addr
],
...
...
@@ -553,15 +553,15 @@ class CycladesClient(TestCase):
AssertionError
:
[
vmid
,
None
],
AssertionError
:
[
vmid
,
''
]}.
items
():
self
.
assertRaises
(
err
,
self
.
client
.
a
ssoc
_floating_ip
_to_server
,
*
args
)
r
=
self
.
client
.
a
ssoc
_floating_ip
_to_server
(
vmid
,
addr
)
err
,
self
.
client
.
a
ttach
_floating_ip
,
*
args
)
r
=
self
.
client
.
a
ttach
_floating_ip
(
vmid
,
addr
)
self
.
assert_dicts_are_equal
(
r
,
FR
.
headers
)
expected
=
dict
(
addFloatingIp
=
dict
(
address
=
addr
))
self
.
assertEqual
(
spost
.
mock_calls
[
-
1
],
call
(
vmid
,
'action'
,
json_data
=
expected
))
@
patch
(
'%s.servers_post'
%
cyclades_pkg
,
return_value
=
FR
())
def
test_d
isassoc
_floating_ip
_to_server
(
self
,
spost
):
def
test_d
etach
_floating_ip
(
self
,
spost
):
vmid
,
addr
=
42
,
'anIpAddress'
for
err
,
args
in
{
ValueError
:
[
'not a server id'
,
addr
],
...
...
@@ -569,8 +569,8 @@ class CycladesClient(TestCase):
AssertionError
:
[
vmid
,
None
],
AssertionError
:
[
vmid
,
''
]}.
items
():
self
.
assertRaises
(
err
,
self
.
client
.
d
isassoc
_floating_ip
_to_server
,
*
args
)
r
=
self
.
client
.
d
isassoc
_floating_ip
_to_server
(
vmid
,
addr
)
err
,
self
.
client
.
d
etach
_floating_ip
,
*
args
)
r
=
self
.
client
.
d
etach
_floating_ip
(
vmid
,
addr
)
self
.
assert_dicts_are_equal
(
r
,
FR
.
headers
)
expected
=
dict
(
removeFloatingIp
=
dict
(
address
=
addr
))
self
.
assertEqual
(
...
...
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