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
e58d2db1
Commit
e58d2db1
authored
May 14, 2013
by
Christos Stavrakakis
Browse files
cyclades: Various fixes to tests
parent
2eac0aad
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/api/test/networks.py
View file @
e58d2db1
...
...
@@ -265,9 +265,10 @@ class NetworkAPITest(BaseAPITest):
self
.
assertFault
(
response
,
403
,
'forbidden'
)
def
test_delete_network
(
self
,
mrapi
):
net
=
mfactory
.
NetworkFactory
()
response
=
self
.
delete
(
'/api/v1.1/networks/%d'
%
net
.
id
,
net
.
userid
)
net
=
mfactory
.
NetworkFactory
(
deleted
=
False
,
state
=
'ACTIVE'
)
with
mocked_quotaholder
():
response
=
self
.
delete
(
'/api/v1.1/networks/%d'
%
net
.
id
,
net
.
userid
)
self
.
assertEqual
(
response
.
status_code
,
204
)
net
=
Network
.
objects
.
get
(
id
=
net
.
id
,
userid
=
net
.
userid
)
self
.
assertEqual
(
net
.
action
,
'DESTROY'
)
...
...
snf-cyclades-app/synnefo/logic/tests.py
View file @
e58d2db1
...
...
@@ -426,6 +426,7 @@ class UpdateNetworkTest(TestCase):
link
=
'prv12'
)
bn1
=
mfactory
.
BackendNetworkFactory
(
network
=
net
)
mfactory
.
BackendNetworkFactory
(
network
=
net
,
operstate
=
"ACTIVE"
,
backend__offline
=
True
)
msg
=
self
.
create_msg
(
operation
=
'OP_NETWORK_REMOVE'
,
network
=
net
.
backend_id
,
...
...
@@ -438,8 +439,10 @@ class UpdateNetworkTest(TestCase):
self
.
assertFalse
(
new_net
.
deleted
)
def
test_error_opcode
(
self
,
client
):
mfactory
.
MacPrefixPoolTableFactory
()
mfactory
.
BridgePoolTableFactory
()
for
state
,
_
in
Network
.
OPER_STATES
:
bn
=
mfactory
.
BackendNetworkFactory
()
bn
=
mfactory
.
BackendNetworkFactory
(
operstate
=
"ACTIVE"
)
bn
.
operstate
=
state
bn
.
save
()
network
=
bn
.
network
...
...
@@ -451,8 +454,11 @@ class UpdateNetworkTest(TestCase):
msg
=
self
.
create_msg
(
operation
=
opcode
,
network
=
bn
.
network
.
backend_id
,
status
=
'error'
,
add_reserved_ips
=
[],
remove_reserved_ips
=
[],
cluster
=
bn
.
backend
.
clustername
)
update_network
(
client
,
msg
)
with
mocked_quotaholder
():
update_network
(
client
,
msg
)
client
.
basic_ack
.
assert_called_once
()
db_bnet
=
BackendNetwork
.
objects
.
get
(
id
=
bn
.
id
)
self
.
assertEqual
(
bn
.
operstate
,
db_bnet
.
operstate
)
...
...
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