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

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

ensure_in_syspath('../../')

# Import Salt libs
from salt.exceptions import SaltInvocationError
import integration


@requires_salt_modules('test.ping')
class ArgumentTestCase(integration.ModuleCase):
    def test_unsupported_kwarg(self):
        '''
        Test passing a non-supported keyword argument
        '''
        self.assertEqual(
            self.run_function('test.ping', ['foo=bar']),
            ("ERROR executing 'test.ping': The following keyword arguments "
             "are not valid: foo=bar")
        )


if __name__ == '__main__':
    from integration import run_tests
    run_tests(ArgumentTestCase)

@@ -343,16 +343,28 @@
 st.ping'
+, 'test.arg'
 )%0Aclass 
@@ -731,16 +731,477 @@
      )%0A%0A
+    def test_kwarg_name_containing_dashes(self):%0A        '''%0A        Tests the arg parser to ensure that kwargs with dashes in the arg name%0A        are properly identified as kwargs. If this fails, then the KWARG_REGEX%0A        in salt/utils/__init__.py needs to be fixed.%0A        '''%0A        self.assertEqual(%0A            self.run_function(%0A                'test.arg', %5B'foo-bar=baz'%5D%0A            ).get('kwargs', %7B%7D).get('foo-bar'),%0A            'baz'%0A        )%0A
 %0Aif __na

Add test for arguments with dashes in the arg name