mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Fix test expected output plus an additional one for pip git install.
This commit is contained in:
parent
6e694791fb
commit
456360dc32
@ -194,7 +194,7 @@ class PipStateTest(TestCase, integration.SaltReturnAssertsMixIn):
|
|||||||
self.assertSaltNoneReturn({'test': ret})
|
self.assertSaltNoneReturn({'test': ret})
|
||||||
self.assertInSaltComment(
|
self.assertInSaltComment(
|
||||||
'Python package git+https://github.com/saltstack/'
|
'Python package git+https://github.com/saltstack/'
|
||||||
'salt-testing.git#egg=SaltTesting>=0.5.1 is set to be '
|
'salt-testing.git#egg=SaltTesting is set to be '
|
||||||
'installed',
|
'installed',
|
||||||
{'test': ret}
|
{'test': ret}
|
||||||
)
|
)
|
||||||
@ -254,6 +254,26 @@ class PipStateTest(TestCase, integration.SaltReturnAssertsMixIn):
|
|||||||
'#md5=e6760af92b7165f8be53b5763e40bc24==???')
|
'#md5=e6760af92b7165f8be53b5763e40bc24==???')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
mock = MagicMock(return_value={'retcode': 0, 'stdout': ''})
|
||||||
|
pip_list = MagicMock(return_value={'pep8': '1.3.1'})
|
||||||
|
pip_install = MagicMock(return_value={
|
||||||
|
'retcode': 0,
|
||||||
|
'stderr' :'',
|
||||||
|
'stdout': 'Cloned!'
|
||||||
|
})
|
||||||
|
with patch.dict(pip.__salt__, {'cmd.run_all': mock,
|
||||||
|
'pip.list': pip_list,
|
||||||
|
'pip.install': pip_install}):
|
||||||
|
with patch.dict(pip.__opts__, {'test': False}):
|
||||||
|
ret = pip.installed(
|
||||||
|
'git+https://github.com/saltstack/salt-testing.git#egg=SaltTesting'
|
||||||
|
)
|
||||||
|
self.assertSaltTrueReturn({'test': ret})
|
||||||
|
self.assertInSaltComment(
|
||||||
|
'Package was successfully installed',
|
||||||
|
{'test': ret}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
from integration import run_tests
|
from integration import run_tests
|
||||||
|
Loading…
Reference in New Issue
Block a user