Skip to content

Commit

Permalink
Set os and os_family in test_run_cwd_in_combination_with_runas
Browse files Browse the repository at this point in the history
  • Loading branch information
cdalvaro committed Dec 31, 2018
1 parent efa8120 commit 68b5724
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/unit/modules/test_cmdmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ def test_run_cwd_in_combination_with_runas(self):
cwd = '/tmp'
runas = 'foobar'

with patch('pwd.getpwnam') as getpwnam_mock:
with patch('pwd.getpwnam') as getpwnam_mock, \
patch.dict(cmdmod.__grains__, {'os': 'Darwin', 'os_family': 'Solaris'}):
stdout = cmdmod._run(cmd, cwd=cwd, runas=runas).get('stdout')
self.assertEqual(stdout, cwd)

Expand Down

0 comments on commit 68b5724

Please sign in to comment.