Commit 2a45d4dc by Őry Máté

vm: fix tests to match new allocate_node

parent e445a532
...@@ -112,8 +112,7 @@ class InstanceTestCase(TestCase): ...@@ -112,8 +112,7 @@ class InstanceTestCase(TestCase):
migrate_op(system=True) migrate_op(system=True)
migr.apply_async.assert_called() migr.apply_async.assert_called()
self.assertIn(call.sub_activity( inst.allocate_node.assert_called()
u'scheduling', readable_name=u'schedule'), act.mock_calls)
inst.select_node.assert_called() inst.select_node.assert_called()
def test_migrate_wo_scheduling(self): def test_migrate_wo_scheduling(self):
...@@ -130,7 +129,7 @@ class InstanceTestCase(TestCase): ...@@ -130,7 +129,7 @@ class InstanceTestCase(TestCase):
migrate_op(to_node=inst.node, system=True) migrate_op(to_node=inst.node, system=True)
migr.apply_async.assert_called() migr.apply_async.assert_called()
self.assertNotIn(call.sub_activity(u'scheduling'), act.mock_calls) inst.allocate_node.assert_called()
def test_migrate_with_error(self): def test_migrate_with_error(self):
inst = Mock(destroyed_at=None, spec=Instance) inst = Mock(destroyed_at=None, spec=Instance)
...@@ -149,11 +148,9 @@ class InstanceTestCase(TestCase): ...@@ -149,11 +148,9 @@ class InstanceTestCase(TestCase):
migr.apply_async.assert_called() migr.apply_async.assert_called()
self.assertIn(call.sub_activity( self.assertIn(call.sub_activity(
u'scheduling', readable_name=u'schedule'), act.mock_calls)
self.assertIn(call.sub_activity(
u'rollback_net', readable_name=u'redeploy network (rollback)'), u'rollback_net', readable_name=u'redeploy network (rollback)'),
act.mock_calls) act.mock_calls)
inst.select_node.assert_called() inst.allocate_node.assert_called()
def test_status_icon(self): def test_status_icon(self):
inst = MagicMock(spec=Instance) inst = MagicMock(spec=Instance)
......
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 sign in to comment