def test_do_node_show_fields(self):
     client_mock = mock.MagicMock()
     args = mock.MagicMock()
     args.node = "node_uuid"
     args.instance_uuid = False
     args.fields = [["uuid", "power_state"]]
     n_shell.do_node_show(client_mock, args)
     client_mock.node.get.assert_called_once_with("node_uuid", fields=["uuid", "power_state"])
 def test_do_node_show_fields(self):
     client_mock = mock.MagicMock()
     args = mock.MagicMock()
     args.node = 'node_uuid'
     args.instance_uuid = False
     args.fields = [['uuid', 'power_state']]
     n_shell.do_node_show(client_mock, args)
     client_mock.node.get.assert_called_once_with(
         'node_uuid', fields=['uuid', 'power_state'])
Пример #3
0
 def test_do_node_show_fields(self):
     client_mock = mock.MagicMock()
     args = mock.MagicMock()
     args.node = 'node_uuid'
     args.instance_uuid = False
     args.fields = [['uuid', 'power_state']]
     n_shell.do_node_show(client_mock, args)
     client_mock.node.get.assert_called_once_with(
         'node_uuid', fields=['uuid', 'power_state'])
Пример #4
0
    def test_do_node_show(self):
        client_mock = mock.MagicMock()
        args = mock.MagicMock()
        args.node = 'node_uuid'
        args.instance_uuid = False

        n_shell.do_node_show(client_mock, args)
        client_mock.node.get.assert_called_once_with('node_uuid')
        # assert get_by_instance_uuid() wasn't called
        self.assertFalse(client_mock.node.get_by_instance_uuid.called)
    def test_do_node_show(self):
        client_mock = mock.MagicMock()
        args = mock.MagicMock()
        args.node = 'node_uuid'
        args.instance_uuid = False

        n_shell.do_node_show(client_mock, args)
        client_mock.node.get.assert_called_once_with('node_uuid')
        # assert get_by_instance_uuid() wasn't called
        self.assertFalse(client_mock.node.get_by_instance_uuid.called)
    def test_do_node_show_by_instance_uuid(self):
        client_mock = mock.MagicMock()
        args = mock.MagicMock()
        args.node = "instance_uuid"
        args.instance_uuid = True
        args.fields = None

        n_shell.do_node_show(client_mock, args)
        client_mock.node.get_by_instance_uuid.assert_called_once_with("instance_uuid", fields=None)
        # assert get() wasn't called
        self.assertFalse(client_mock.node.get.called)
Пример #7
0
    def test_do_node_show_by_instance_uuid(self):
        client_mock = mock.MagicMock()
        args = mock.MagicMock()
        args.node = 'instance_uuid'
        args.instance_uuid = True
        args.fields = None

        n_shell.do_node_show(client_mock, args)
        client_mock.node.get_by_instance_uuid.assert_called_once_with(
            'instance_uuid', fields=None)
        # assert get() wasn't called
        self.assertFalse(client_mock.node.get.called)