mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Auth to become (#33319)
* terminal.on_(de)?authorize -> terminal.on_(un)?become * Update network_cli * Readd on_(de)?authorize as wrappers * Update tests
This commit is contained in:
parent
53d9f9ffae
commit
a1da3dc997
11 changed files with 35 additions and 23 deletions
|
@ -74,7 +74,7 @@ class TestConnectionClass(unittest.TestCase):
|
|||
|
||||
conn._connect()
|
||||
self.assertTrue(conn._terminal.on_open_shell.called)
|
||||
self.assertFalse(conn._terminal.on_authorize.called)
|
||||
self.assertFalse(conn._terminal.on_become.called)
|
||||
|
||||
conn._play_context.become = True
|
||||
conn._play_context.become_method = 'enable'
|
||||
|
@ -82,7 +82,7 @@ class TestConnectionClass(unittest.TestCase):
|
|||
conn._connected = False
|
||||
|
||||
conn._connect()
|
||||
conn._terminal.on_authorize.assert_called_with(passwd='password')
|
||||
conn._terminal.on_become.assert_called_with(passwd='password')
|
||||
|
||||
@patch("ansible.plugins.connection.paramiko_ssh.Connection.close")
|
||||
def test_network_cli_close(self, mocked_super):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue