mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Close & remove paramiko connection where appropriate (#37528)
* Close & remove paramiko connection where appropriate * Update unit test
This commit is contained in:
@@ -93,11 +93,13 @@ class TestConnectionClass(unittest.TestCase):
|
||||
terminal = MagicMock(supports_multiplexing=False)
|
||||
conn._terminal = terminal
|
||||
conn._ssh_shell = MagicMock()
|
||||
conn.paramiko_conn = MagicMock()
|
||||
conn._connected = True
|
||||
|
||||
conn.close()
|
||||
self.assertTrue(terminal.on_close_shell.called)
|
||||
self.assertIsNone(conn._ssh_shell)
|
||||
self.assertIsNone(conn.paramiko_conn)
|
||||
|
||||
@patch("ansible.plugins.connection.paramiko_ssh.Connection._connect")
|
||||
def test_network_cli_exec_command(self, mocked_super):
|
||||
|
||||
Reference in New Issue
Block a user