def test_do_driver_properties(self):
        client_mock = mock.MagicMock()
        args = mock.MagicMock()
        args.driver_name = 'driver_name'

        d_shell.do_driver_properties(client_mock, args)
        client_mock.driver.properties_called_once_with("driver_name")
Esempio n. 2
0
    def test_do_driver_properties(self):
        client_mock = self.client_mock
        args = mock.MagicMock()
        args.driver_name = 'driver_name'

        d_shell.do_driver_properties(client_mock, args)
        client_mock.driver.properties.assert_called_once_with("driver_name")
    def test_do_driver_properties(self):
        client_mock = self.client_mock
        args = mock.MagicMock()
        args.driver_name = 'driver_name'
        args.json = False

        d_shell.do_driver_properties(client_mock, args)
        client_mock.driver.properties.assert_called_once_with("driver_name")
    def test_do_driver_properties_with_wrap(self, mock_print_dict):
        client_mock = self.client_mock
        client_mock.driver.properties.return_value = {
            'foo': 'bar',
            'baz': 'qux'}
        args = mock.MagicMock()
        args.driver_name = 'driver_name'
        args.wrap = 80

        d_shell.do_driver_properties(client_mock, args)
        mock_print_dict.assert_called_with(
            {'foo': 'bar', 'baz': 'qux'},
            dict_value='Description',
            wrap=80)
Esempio n. 5
0
    def test_do_driver_properties_with_wrap(self, mock_print_dict):
        client_mock = self.client_mock
        client_mock.driver.properties.return_value = {
            'foo': 'bar',
            'baz': 'qux'}
        args = mock.MagicMock()
        args.driver_name = 'driver_name'
        args.wrap = 80
        args.json = False

        d_shell.do_driver_properties(client_mock, args)
        mock_print_dict.assert_called_with(
            {'foo': 'bar', 'baz': 'qux'},
            dict_value='Description',
            json_flag=False,
            wrap=80)