mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Added test case for the prompt argument to virtualenv_mod
.
This commit is contained in:
parent
90df84fb27
commit
45c258e00b
@ -331,6 +331,32 @@ class VirtualenvTestCase(TestCase):
|
||||
runas=None
|
||||
)
|
||||
|
||||
def test_prompt_argument(self):
|
||||
mock = MagicMock(return_value={'retcode': 0, 'stdout': ''})
|
||||
with patch.dict(virtualenv_mod.__salt__, {'cmd.run_all': mock}):
|
||||
virtualenv_mod.create('/tmp/foo', prompt='PY Prompt')
|
||||
mock.assert_called_once_with(
|
||||
'virtualenv --prompt=\'PY Prompt\' /tmp/foo',
|
||||
runas=None
|
||||
)
|
||||
|
||||
# Now with some quotes on the mix
|
||||
mock = MagicMock(return_value={'retcode': 0, 'stdout': ''})
|
||||
with patch.dict(virtualenv_mod.__salt__, {'cmd.run_all': mock}):
|
||||
virtualenv_mod.create('/tmp/foo', prompt='\'PY\' Prompt')
|
||||
mock.assert_called_once_with(
|
||||
'virtualenv --prompt="\'PY\' Prompt" /tmp/foo',
|
||||
runas=None
|
||||
)
|
||||
|
||||
mock = MagicMock(return_value={'retcode': 0, 'stdout': ''})
|
||||
with patch.dict(virtualenv_mod.__salt__, {'cmd.run_all': mock}):
|
||||
virtualenv_mod.create('/tmp/foo', prompt='"PY" Prompt')
|
||||
mock.assert_called_once_with(
|
||||
'virtualenv --prompt=\'"PY" Prompt\' /tmp/foo',
|
||||
runas=None
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from integration import run_tests
|
||||
|
Loading…
Reference in New Issue
Block a user