From 716f760e806f098cb11d08c7637a9ddd06f51e57 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 14 Jul 2013 17:19:14 +0100 Subject: [PATCH] Added a mocked test case for `--no-deps` passing to `pip install`. --- tests/unit/modules/pip_test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/unit/modules/pip_test.py b/tests/unit/modules/pip_test.py index fc9a0a55af..e5b71c6ede 100644 --- a/tests/unit/modules/pip_test.py +++ b/tests/unit/modules/pip_test.py @@ -556,6 +556,15 @@ class PipTestCase(TestCase): cwd=None ) + def test_no_deps_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_deps=True) + mock.assert_called_once_with( + 'pip install --no-deps pep8', + runas=None, + cwd=None + ) if __name__ == '__main__':