mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #46228 from twangboy/win_fix_test_pip
Fix `unit.modules.test_pip` for Windows
This commit is contained in:
commit
44343f8063
2 changed files with 2 additions and 6 deletions
|
@ -139,11 +139,7 @@ def _get_pip_bin(bin_env):
|
|||
# try to get pip bin from virtualenv, bin_env
|
||||
if os.path.isdir(bin_env):
|
||||
if salt.utils.platform.is_windows():
|
||||
if six.PY2:
|
||||
pip_bin = os.path.join(
|
||||
bin_env, 'Scripts', 'pip.exe').encode('string-escape')
|
||||
else:
|
||||
pip_bin = os.path.join(bin_env, 'Scripts', 'pip.exe')
|
||||
pip_bin = os.path.join(bin_env, 'Scripts', 'pip.exe')
|
||||
else:
|
||||
pip_bin = os.path.join(bin_env, 'bin', 'pip')
|
||||
if os.path.isfile(pip_bin):
|
||||
|
|
|
@ -298,7 +298,7 @@ class PipTestCase(TestCase, LoaderModuleMockMixin):
|
|||
with patch.dict(pip.__salt__, {'cmd.run_all': mock}):
|
||||
if salt.utils.platform.is_windows():
|
||||
venv_path = 'c:\\test_env'
|
||||
bin_path = os.path.join(venv_path, 'Scripts', 'pip.exe').encode('string-escape')
|
||||
bin_path = os.path.join(venv_path, 'Scripts', 'pip.exe')
|
||||
else:
|
||||
venv_path = '/test_env'
|
||||
bin_path = os.path.join(venv_path, 'bin', 'pip')
|
||||
|
|
Loading…
Add table
Reference in a new issue