Skip to content

Commit

Permalink
test_chroot: assert over cmd.run_chroot params
Browse files Browse the repository at this point in the history
  • Loading branch information
aplanas committed Sep 12, 2019
1 parent b87c46c commit 4c82038
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/unit/modules/test_chroot.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ def test_call_fails_salt_thin(self, mkdtemp, exist):
utils_mock['thin.gen_thin'].assert_called_once()
salt_mock['config.option'].assert_called()
salt_mock['archive.tar'].assert_called_once()
salt_mock['cmd.run_chroot'].assert_called_once()
salt_mock['cmd.run_chroot'].assert_called_with(
'/chroot',
['python{}'.format(sys.version_info[0]), '/tmp01/salt-call',
'--metadata', '--local',
'--log-file', '/tmp01/log', '--cachedir', '/tmp01/cache',
'--out', 'json', '-l', 'quiet', '--', 'test.ping'])
utils_mock['files.rm_rf'].assert_called_once()

@patch('salt.modules.chroot.exist')
Expand Down Expand Up @@ -181,7 +186,12 @@ def test_call_success(self, mkdtemp, exist):
utils_mock['thin.gen_thin'].assert_called_once()
salt_mock['config.option'].assert_called()
salt_mock['archive.tar'].assert_called_once()
salt_mock['cmd.run_chroot'].assert_called_once()
salt_mock['cmd.run_chroot'].assert_called_with(
'/chroot',
['python{}'.format(sys.version_info[0]), '/tmp01/salt-call',
'--metadata', '--local',
'--log-file', '/tmp01/log', '--cachedir', '/tmp01/cache',
'--out', 'json', '-l', 'quiet', '--', 'test.ping'])
utils_mock['files.rm_rf'].assert_called_once()

@patch('salt.modules.chroot.exist')
Expand Down

0 comments on commit 4c82038

Please sign in to comment.