Skip to content

Commit

Permalink
Merge pull request #55244 from cmcmarrow/lscmdwin
Browse files Browse the repository at this point in the history
Lscmdwin
  • Loading branch information
dwoz committed Dec 6, 2019
2 parents cbc20c2 + ad2e417 commit a02fbd8
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions tests/integration/states/test_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,37 @@
import salt.utils.files
import salt.utils.platform

IS_WINDOWS = salt.utils.platform.is_windows()


class CMDTest(ModuleCase, SaltReturnAssertsMixin):
'''
Validate the cmd state
'''
@classmethod
def setUpClass(cls):
cls.__cmd = 'dir' if salt.utils.platform.is_windows() else 'ls'

def test_run_simple(self):
'''
cmd.run
'''
cmd = 'dir' if IS_WINDOWS else 'ls'
ret = self.run_state('cmd.run', name=cmd, cwd=tempfile.gettempdir())
ret = self.run_state('cmd.run', name=self.__cmd, cwd=tempfile.gettempdir())
self.assertSaltTrueReturn(ret)

def test_test_run_simple(self):
'''
cmd.run test interface
'''
ret = self.run_state('cmd.run', name='ls',
ret = self.run_state('cmd.run', name=self.__cmd,
cwd=tempfile.gettempdir(), test=True)
self.assertSaltNoneReturn(ret)

def test_run_hide_output(self):
'''
cmd.run with output hidden
'''

cmd = 'dir' if IS_WINDOWS else 'ls'
ret = self.run_state(
'cmd.run',
name=cmd,
u'cmd.run',
name=self.__cmd,
hide_output=True)
self.assertSaltTrueReturn(ret)
ret = ret[next(iter(ret))]
Expand Down

0 comments on commit a02fbd8

Please sign in to comment.