salt/tests/unit/utils/args.py

34 lines
809 B
Python
Raw Normal View History

2014-10-20 22:53:56 +00:00
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import
2014-10-20 22:53:56 +00:00
# Import Salt Libs
from salt.utils import args
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import NO_MOCK, NO_MOCK_REASON
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
2014-10-21 03:21:01 +00:00
2014-10-20 22:53:56 +00:00
@skipIf(NO_MOCK, NO_MOCK_REASON)
class ArgsTestCase(TestCase):
'''
TestCase for salt.utils.args module
'''
def test_condition_input_string(self):
'''
Test passing a jid on the command line
'''
cmd = args.condition_input(['*', 'foo.bar', 20141020201325675584], None)
self.assertIsInstance(cmd[2], str)
if __name__ == '__main__':
from integration import run_tests
run_tests(ArgsTestCase, needs_daemon=False)