<commit_before># -*- coding: utf-8 -*-
'''
    :codeauthor: :email:`<NAME> <<EMAIL>>`
'''

# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
    MagicMock,
    patch,
    NO_MOCK,
    NO_MOCK_REASON
)
# Make sure augeas python interface is installed
HAS_AUGEAS = False
try:
    from augeas import Augeas as _Augeas
    HAS_AUGEAS = True
except ImportError:
    pass

# Import Salt Libs
from salt.modules import augeas_cfg
from salt.exceptions import SaltInvocationError


@skipIf(NO_MOCK, NO_MOCK_REASON)
class AugeasCfgTestCase(TestCase):
    '''
    Test cases for salt.modules.augeas_cfg
    '''
    # 'execute' function tests: 3

    def test_execute(self):
        '''
        Test if it execute Augeas commands
        '''
        self.assertEqual(augeas_cfg.execute(), {'retval': True})

    def test_execute_io_error(self):
        '''
        Test if it execute Augeas commands
        '''
        ret = {'error': 'Command  is not supported (yet)', 'retval': False}
        self.assertEqual(augeas_cfg.execute(None, None, [" "]), ret)


    def test_execute_value_error(self):
        '''
        Test if it execute Augeas commands
        '''
        ret = {'retval': False,
               'error':
        'Invalid formatted command, see debug log for details: '}
        self.assertEqual(augeas_cfg.execute(None, None, ["set "]), ret)

    # 'get' function tests: 1

    def test_get(self):<commit_msg>removed pylint error in augeas_cfg unit test case<commit_after># -*- coding: utf-8 -*-
'''
    :codeauthor: :email:`<NAME> <<EMAIL>>`
'''

# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
    MagicMock,
    patch,
    NO_MOCK,
    NO_MOCK_REASON
)
# Make sure augeas python interface is installed
HAS_AUGEAS = False
try:
    from augeas import Augeas as _Augeas
    HAS_AUGEAS = True
except ImportError:
    pass

# Import Salt Libs
from salt.modules import augeas_cfg
from salt.exceptions import SaltInvocationError


@skipIf(NO_MOCK, NO_MOCK_REASON)
class AugeasCfgTestCase(TestCase):
    '''
    Test cases for salt.modules.augeas_cfg
    '''
    # 'execute' function tests: 3

    def test_execute(self):
        '''
        Test if it execute Augeas commands
        '''
        self.assertEqual(augeas_cfg.execute(), {'retval': True})

    def test_execute_io_error(self):
        '''
        Test if it execute Augeas commands
        '''
        ret = {'error': 'Command  is not supported (yet)', 'retval': False}
        self.assertEqual(augeas_cfg.execute(None, None, [" "]), ret)

    def test_execute_value_error(self):
        '''
        Test if it execute Augeas commands
        '''
        ret = {'retval': False,
               'error':
        'Invalid formatted command, see debug log for details: '}
        self.assertEqual(augeas_cfg.execute(None, None, ["set "]), ret)

    # 'get' function tests: 1

    def test_get(self):
{'fraction_non_alphanumeric': 0.11144883485309018, 'fraction_numerical': 0.002026342451874367, 'mean_word_length': 2.831824062095731, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2476894', 'n_tokens_mistral': 943, 'n_tokens_neox': 913, 'n_words': 260}