1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
This commit is contained in:
Yannig Perré 2015-12-22 16:30:29 +01:00 committed by Brian Coca
parent c4da5840b5
commit b22d998d1d

View file

@ -42,14 +42,14 @@ class TestActionBase(unittest.TestCase):
play_context.become = True play_context.become = True
play_context.become_user = play_context.remote_user = 'root' play_context.become_user = play_context.remote_user = 'root'
play_context.make_become_cmd = Mock(return_value='CMD') play_context.make_become_cmd = Mock(return_value=b'CMD')
action_base._low_level_execute_command('ECHO', sudoable=True) action_base._low_level_execute_command(b'ECHO', sudoable=True)
play_context.make_become_cmd.assert_not_called() play_context.make_become_cmd.assert_not_called()
play_context.remote_user = 'apo' play_context.remote_user = 'apo'
action_base._low_level_execute_command('ECHO', sudoable=True) action_base._low_level_execute_command(b'ECHO', sudoable=True)
play_context.make_become_cmd.assert_called_once_with('ECHO', executable=None) play_context.make_become_cmd.assert_called_once_with(b'ECHO', executable=None)
play_context.make_become_cmd.reset_mock() play_context.make_become_cmd.reset_mock()
@ -57,7 +57,7 @@ class TestActionBase(unittest.TestCase):
C.BECOME_ALLOW_SAME_USER = True C.BECOME_ALLOW_SAME_USER = True
try: try:
play_context.remote_user = 'root' play_context.remote_user = 'root'
action_base._low_level_execute_command('ECHO SAME', sudoable=True) action_base._low_level_execute_command(b'ECHO SAME', sudoable=True)
play_context.make_become_cmd.assert_called_once_with('ECHO SAME', executable=None) play_context.make_become_cmd.assert_called_once_with(b'ECHO SAME', executable=None)
finally: finally:
C.BECOME_ALLOW_SAME_USER = become_allow_same_user C.BECOME_ALLOW_SAME_USER = become_allow_same_user