Merge "Add unit tests for "ironic node-delete" shell cmd"

This commit is contained in:
Jenkins
2014-09-15 16:41:06 +00:00
committed by Gerrit Code Review

View File

@@ -49,6 +49,23 @@ class NodeShellTest(utils.BaseTestCase):
act = actual.keys()
self.assertEqual(sorted(exp), sorted(act))
def test_do_node_delete(self):
client_mock = mock.MagicMock()
args = mock.MagicMock()
args.node = ['node_uuid']
n_shell.do_node_delete(client_mock, args)
client_mock.node.delete.assert_called_once_with('node_uuid')
def test_do_node_delete_multiple(self):
client_mock = mock.MagicMock()
args = mock.MagicMock()
args.node = ['node_uuid1', 'node_uuid2']
n_shell.do_node_delete(client_mock, args)
client_mock.node.delete.assert_has_calls(
[mock.call('node_uuid1'), mock.call('node_uuid2')])
def test_do_node_vendor_passthru_with_args(self):
client_mock = mock.MagicMock()
args = mock.MagicMock()