mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Fix a couple of PY3 test failures in the rsync module
Fixes: - unit.modules.test_rsync.RsyncTestCase.test_rsync - unit.modules.test_rsync.RsyncTestCase.test_version
This commit is contained in:
parent
76a4d70449
commit
ecb1e3cf82
@ -7,7 +7,7 @@ Wrapper for rsync
|
||||
This data can also be passed into :ref:`pillar <pillar-walk-through>`.
|
||||
Options passed into opts will overwrite options passed into pillar.
|
||||
'''
|
||||
from __future__ import absolute_import
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
# Import python libs
|
||||
import errno
|
||||
|
@ -3,7 +3,7 @@
|
||||
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
|
||||
'''
|
||||
# Import Python libs
|
||||
from __future__ import absolute_import
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
# Import Salt Testing Libs
|
||||
from tests.support.mixins import LoaderModuleMockMixin
|
||||
@ -37,7 +37,7 @@ class RsyncTestCase(TestCase, LoaderModuleMockMixin):
|
||||
|
||||
with patch.dict(rsync.__salt__,
|
||||
{'config.option': MagicMock(return_value='A'),
|
||||
'cmd.run_all': MagicMock(side_effect=[IOError('f'),
|
||||
'cmd.run_all': MagicMock(side_effect=[OSError(1, 'f'),
|
||||
'A'])}):
|
||||
with patch.object(rsync, '_check', return_value=['A']):
|
||||
self.assertRaises(CommandExecutionError, rsync.rsync, 'a', 'b')
|
||||
@ -48,7 +48,7 @@ class RsyncTestCase(TestCase, LoaderModuleMockMixin):
|
||||
'''
|
||||
Test for return rsync version
|
||||
'''
|
||||
mock = MagicMock(side_effect=[IOError('f'), 'A B C\n'])
|
||||
mock = MagicMock(side_effect=[OSError(1, 'f'), 'A B C\n'])
|
||||
with patch.dict(rsync.__salt__, {'cmd.run_stdout': mock}):
|
||||
self.assertRaises(CommandExecutionError, rsync.version)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user