From 3e97e36e786adeb473791f22f7bedd2df6973be2 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 14 Jul 2013 18:54:36 +0100 Subject: [PATCH] Added a mocked test case for `--proxy` passing to `pip uninstall`. --- tests/unit/modules/pip_test.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/unit/modules/pip_test.py b/tests/unit/modules/pip_test.py index d91ed34453..7907031263 100644 --- a/tests/unit/modules/pip_test.py +++ b/tests/unit/modules/pip_test.py @@ -679,6 +679,19 @@ class PipTestCase(TestCase): cwd=None ) + def test_uninstall_proxy_argument_in_resulting_command(self): + mock = MagicMock(return_value={'retcode': 0, 'stdout': ''}) + with patch.dict(pip.__salt__, {'cmd.run_all': mock}): + pip.uninstall( + 'pep8', proxy='salt-user:salt-passwd@salt-proxy:3128' + ) + mock.assert_called_once_with( + 'pip uninstall -y ' + '--proxy=\'salt-user:salt-passwd@salt-proxy:3128\' pep8', + runas=None, + cwd=None + ) + if __name__ == '__main__': from integration import run_tests