mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #41293 from terminalmage/py3-tests
Python 3 test fixes + better pip/virtualenv detection.
This commit is contained in:
commit
c2377cd2d0
@ -121,7 +121,8 @@ def _get_pip_bin(bin_env):
|
||||
if not bin_env:
|
||||
which_result = __salt__['cmd.which_bin'](
|
||||
['pip{0}.{1}'.format(*sys.version_info[:2]),
|
||||
'pip', 'pip2', 'pip3', 'pip-python']
|
||||
'pip{0}'.format(sys.version_info[0]),
|
||||
'pip', 'pip-python']
|
||||
)
|
||||
if salt.utils.is_windows() and six.PY2:
|
||||
which_result.encode('string-escape')
|
||||
|
@ -11,6 +11,7 @@ import glob
|
||||
import shutil
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils
|
||||
@ -19,13 +20,11 @@ import salt.utils.verify
|
||||
from salt.exceptions import CommandExecutionError, SaltInvocationError
|
||||
from salt.ext.six import string_types
|
||||
|
||||
KNOWN_BINARY_NAMES = frozenset(
|
||||
['virtualenv',
|
||||
'virtualenv2',
|
||||
'virtualenv-2.6',
|
||||
'virtualenv-2.7'
|
||||
]
|
||||
)
|
||||
KNOWN_BINARY_NAMES = frozenset([
|
||||
'virtualenv-{0}.{1}'.format(*sys.version_info[:2]),
|
||||
'virtualenv{0}'.format(sys.version_info[0]),
|
||||
'virtualenv',
|
||||
])
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -253,6 +253,6 @@ class TestJobs(cptc.BaseRestCherryPyTest):
|
||||
'X-Auth-Token': self._token(),
|
||||
})
|
||||
|
||||
resp = json.loads(response.body[0])
|
||||
resp = json.loads(salt.utils.to_str(response.body[0]))
|
||||
self.assertIn('test.ping', str(resp['return']))
|
||||
self.assertEqual(response.status, '200 OK')
|
||||
|
Loading…
Reference in New Issue
Block a user