<commit_before># -*- coding: utf-8 -*-
'''
    Test Salt's argument parser
'''

# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath, requires_salt_modules

ensure_in_syspath('../../')

# Import Salt libs
import integration


@requires_salt_modules('test.ping', 'test.arg')
class ArgumentTestCase(integration.ModuleCase):
    def test_unsupported_kwarg(self):
        '''
        Test passing a non-supported keyword argument. The relevant code that
        checks for invalid kwargs is located in salt/minion.py, within the
        'parse_args_and_kwargs' function.
        '''
        self.assertEqual(
            self.run_function('test.ping', ['foo=bar']),
            ("ERROR executing 'test.ping': The following keyword arguments "
             "are not valid: foo=bar")
        )

    def test_kwarg_name_containing_dashes(self):
        '''<commit_msg>Fix test where the arg passing should run through<commit_after># -*- coding: utf-8 -*-
'''
    Test Salt's argument parser
'''

# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath, requires_salt_modules

ensure_in_syspath('../../')

# Import Salt libs
import integration


@requires_salt_modules('test.ping', 'test.arg')
class ArgumentTestCase(integration.ModuleCase):
    def test_unsupported_kwarg(self):
        '''
        Test passing a non-supported keyword argument. The relevant code that
        checks for invalid kwargs is located in salt/minion.py, within the
        'parse_args_and_kwargs' function.
        '''
        self.assertEqual(
            self.run_function('test.ping', ['foo=bar']),
            ("ERROR executing 'test.ping': The following keyword arguments "
             "are not valid: {'foo': 'bar'}")
        )

    def test_kwarg_name_containing_dashes(self):
        '''
{'fraction_non_alphanumeric': 0.11141753998896856, 'fraction_numerical': 0.0011031439602868175, 'mean_word_length': 3.049107142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '393556', 'n_tokens_mistral': 518, 'n_tokens_neox': 499, 'n_words': 141}