Added a mocked test case for --proxy passing to pip uninstall.

This commit is contained in:
Pedro Algarvio 2013-07-14 18:54:36 +01:00
parent ebd8516a8b
commit 3e97e36e78

View File

@ -679,6 +679,19 @@ class PipTestCase(TestCase):
cwd=None 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__': if __name__ == '__main__':
from integration import run_tests from integration import run_tests