Test if --pre option argument ends up in the resulting command line for pip.install.

This commit is contained in:
Pedro Algarvio 2013-07-24 08:03:50 +01:00
parent b8dc7f35a4
commit 98c63b9671

View File

@ -843,6 +843,18 @@ class PipTestCase(TestCase):
}
)
def test_install_pre_argument_in_resulting_command(self):
mock = MagicMock(return_value={'retcode': 0, 'stdout': ''})
with patch.dict(pip.__salt__, {'cmd.run_all': mock}):
pip.install(
'pep8', pre_releases=True
)
mock.assert_called_once_with(
'pip install --pre pep8',
runas=None,
cwd=None
)
if __name__ == '__main__':