Added a mocked test case for --no-index passing to pip install.

This commit is contained in:
Pedro Algarvio 2013-07-14 16:22:52 +01:00
parent 467d7de4e5
commit 6e0e8fddf9

View File

@ -355,6 +355,16 @@ class PipTestCase(TestCase):
cwd=None
)
def test_no_index_argument_in_resulting_command(self):
mock = MagicMock(return_value={'retcode': 0, 'stdout': ''})
with patch.dict(pip.__salt__, {'cmd.run_all': mock}):
pip.install('pep8', no_index=True)
mock.assert_called_once_with(
'pip install --no-index pep8',
runas=None,
cwd=None
)
if __name__ == '__main__':
from integration import run_tests
run_tests(PipTestCase, needs_daemon=False)