Commit d590fbc4 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Fix bug in unittest

The 'serial' attribute is automatically cleared from the VM model when
the corresponding commission is resolved and so is not available in the
unittest. This commit fixes this issue by not explicitly checking for
the specific serial number.
parent 669782c8
......@@ -245,9 +245,14 @@ class ServerCommandTest(TransactionTestCase):
with mocked_quotaholder() as m:
try:
servers.start(vm)
except:
m.resolve_commissions\
.assert_called_once_with([], [vm.serial.serial])
except Exception:
(accept, reject), kwargs = m.resolve_commissions.call_args
self.assertEqual(accept, [])
self.assertEqual(len(reject), 1)
self.assertEqual(kwargs, {})
else:
raise AssertionError("Starting a server should raise an"
" exception.")
def test_task_after(self, mrapi):
return
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment