mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #53210 from Ch3LL/cp-52787
Cherry-Pick #52787 into 2019.2.1
This commit is contained in:
commit
f5f80af440
6 changed files with 9 additions and 25 deletions
|
@ -66,8 +66,8 @@ if HAS_PIP is True:
|
|||
ver2='18.1'):
|
||||
from pip._internal.exceptions import InstallationError # pylint: disable=E0611,E0401
|
||||
elif salt.utils.versions.compare(ver1=pip.__version__,
|
||||
oper='>=',
|
||||
ver2='10.0'):
|
||||
oper='>=',
|
||||
ver2='1.0'):
|
||||
from pip.exceptions import InstallationError # pylint: disable=E0611,E0401
|
||||
else:
|
||||
InstallationError = ValueError
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
- system_site_packages: False
|
||||
- distribute: True
|
||||
{#- Provide the real path for the python executable in case tests are running inside a virtualenv #}
|
||||
{%- if salt.runtests_helpers.get_python_executable() %}
|
||||
- python: {{ salt.runtests_helpers.get_python_executable() }}
|
||||
{%- endif %}
|
||||
|
||||
pep8-pip:
|
||||
pip.installed:
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
- system_site_packages: False
|
||||
- distribute: True
|
||||
{#- Provide the real path for the python executable in case tests are running inside a virtualenv #}
|
||||
{%- if salt.runtests_helpers.get_python_executable() %}
|
||||
- python: {{ salt.runtests_helpers.get_python_executable() }}
|
||||
{%- endif %}
|
||||
|
||||
install_older_venv_1:
|
||||
pip.installed:
|
||||
|
|
|
@ -2034,6 +2034,7 @@ class StateModuleTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
for id in _expected:
|
||||
self.assertEqual(sls[id]['comment'], _expected[id]['comment'])
|
||||
|
||||
@skipIf(six.PY3 and salt.utils.platform.is_darwin(), 'Test is broken on macosx and PY3')
|
||||
def test_state_sls_unicode_characters(self):
|
||||
'''
|
||||
test state.sls when state file contains non-ascii characters
|
||||
|
@ -2044,6 +2045,7 @@ class StateModuleTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
_expected = "cmd_|-echo1_|-echo 'This is Æ test!'_|-run"
|
||||
self.assertIn(_expected, ret)
|
||||
|
||||
@skipIf(six.PY3 and salt.utils.platform.is_darwin(), 'Test is broken on macosx and PY3')
|
||||
def test_state_sls_unicode_characters_cmd_output(self):
|
||||
'''
|
||||
test the output from running and echo command with non-ascii
|
||||
|
|
|
@ -49,6 +49,7 @@ class MinionTest(ShellCase, testprogram.TestProgramCase, ShellCaseCommonTestsMix
|
|||
'subminion',
|
||||
)
|
||||
|
||||
@skipIf(salt.utils.platform.is_darwin(), 'Test is flaky on macosx')
|
||||
def test_issue_7754(self):
|
||||
old_cwd = os.getcwd()
|
||||
config_dir = os.path.join(TMP, 'issue-7754')
|
||||
|
|
|
@ -256,29 +256,6 @@ class PipStateTest(TestCase, SaltReturnAssertsMixin, LoaderModuleMockMixin):
|
|||
{'test': ret}
|
||||
)
|
||||
|
||||
# Test VCS installations with version info like >= 0.1
|
||||
with patch.object(pip, '__version__', MagicMock(side_effect=AttributeError(
|
||||
'Faked missing __version__ attribute'))):
|
||||
mock = MagicMock(return_value={'retcode': 0, 'stdout': ''})
|
||||
pip_list = MagicMock(return_value={'SaltTesting': '0.5.0'})
|
||||
pip_install = MagicMock(return_value={
|
||||
'retcode': 0,
|
||||
'stderr': '',
|
||||
'stdout': 'Cloned!'
|
||||
})
|
||||
with patch.dict(pip_state.__salt__, {'cmd.run_all': mock,
|
||||
'pip.list': pip_list,
|
||||
'pip.install': pip_install}):
|
||||
with patch.dict(pip_state.__opts__, {'test': False}):
|
||||
ret = pip_state.installed(
|
||||
'git+https://github.com/saltstack/salt-testing.git#egg=SaltTesting>=0.5.0'
|
||||
)
|
||||
self.assertSaltTrueReturn({'test': ret})
|
||||
self.assertInSaltComment(
|
||||
'packages are already installed',
|
||||
{'test': ret}
|
||||
)
|
||||
|
||||
def test_install_in_editable_mode(self):
|
||||
'''
|
||||
Check that `name` parameter containing bad characters is not parsed by
|
||||
|
|
Loading…
Add table
Reference in a new issue