Merge pull request #45092 from terminalmage/fix-pip-test

Fix integration.states.test_pip.PipStateTest.test_pip_installed_weird_install
This commit is contained in:
Nicole Thomas 2017-12-20 05:52:08 -05:00 committed by GitHub
commit 19997e4d81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -29,7 +29,7 @@ setup_test_virtualenv:
carbon-weird-setup:
pip.installed:
- name: carbon
- name: 'carbon < 1.1'
- no_deps: True
- bin_env: {{ virtualenv_test }}
- onchanges:

View file

@ -161,19 +161,19 @@ class PipStateTest(ModuleCase, SaltReturnAssertsMixin):
# some of the state return parts
for key in six.iterkeys(ret):
self.assertTrue(ret[key]['result'])
if ret[key]['name'] != 'carbon':
if ret[key]['name'] != 'carbon < 1.1':
continue
self.assertEqual(
ret[key]['comment'],
'There was no error installing package \'carbon\' '
'There was no error installing package \'carbon < 1.1\' '
'although it does not show when calling \'pip.freeze\'.'
)
break
else:
raise Exception('Expected state did not run')
finally:
if os.path.isdir('/opt/graphite'):
shutil.rmtree('/opt/graphite')
if os.path.isdir(ographite):
shutil.rmtree(ographite)
def test_issue_2028_pip_installed_state(self):
ret = self.run_function('state.sls', mods='issue-2028-pip-installed')