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:
Nathaniel Case 2017-11-28 16:28:58 -05:00 committed by GitHub
parent 53d9f9ffae
commit a1da3dc997
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 35 additions and 23 deletions

View file

@ -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):