1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix up connection plugin test for new_stdin parameter

This commit is contained in:
Toshio Kuratomi 2015-04-27 10:50:08 -07:00
parent bf003d31e0
commit 50da8812d6

View file

@ -19,6 +19,8 @@
from __future__ import (absolute_import, division, print_function) from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
from six import StringIO
from ansible.compat.tests import unittest from ansible.compat.tests import unittest
from ansible.executor.connection_info import ConnectionInformation from ansible.executor.connection_info import ConnectionInformation
@ -29,7 +31,7 @@ from ansible.plugins.connections import ConnectionBase
#from ansible.plugins.connections.jail import Connection as JailConnection #from ansible.plugins.connections.jail import Connection as JailConnection
#from ansible.plugins.connections.libvirt_lxc import Connection as LibvirtLXCConnection #from ansible.plugins.connections.libvirt_lxc import Connection as LibvirtLXCConnection
from ansible.plugins.connections.local import Connection as LocalConnection from ansible.plugins.connections.local import Connection as LocalConnection
#from ansible.plugins.connections.paramiko_ssh import Connection as ParamikoConnection from ansible.plugins.connections.paramiko_ssh import Connection as ParamikoConnection
from ansible.plugins.connections.ssh import Connection as SSHConnection from ansible.plugins.connections.ssh import Connection as SSHConnection
#from ansible.plugins.connections.winrm import Connection as WinRmConnection #from ansible.plugins.connections.winrm import Connection as WinRmConnection
@ -37,6 +39,7 @@ class TestConnectionBaseClass(unittest.TestCase):
def setUp(self): def setUp(self):
self.conn_info = ConnectionInformation() self.conn_info = ConnectionInformation()
self.in_stream = StringIO()
def tearDown(self): def tearDown(self):
pass pass
@ -69,7 +72,7 @@ class TestConnectionBaseClass(unittest.TestCase):
pass pass
def close(self): def close(self):
pass pass
self.assertIsInstance(ConnectionModule3(self.conn_info), ConnectionModule3) self.assertIsInstance(ConnectionModule3(self.conn_info, self.in_stream), ConnectionModule3)
# def test_accelerate_connection_module(self): # def test_accelerate_connection_module(self):
# self.assertIsInstance(AccelerateConnection(), AccelerateConnection) # self.assertIsInstance(AccelerateConnection(), AccelerateConnection)
@ -87,13 +90,13 @@ class TestConnectionBaseClass(unittest.TestCase):
# self.assertIsInstance(LibvirtLXCConnection(), LibvirtLXCConnection) # self.assertIsInstance(LibvirtLXCConnection(), LibvirtLXCConnection)
def test_local_connection_module(self): def test_local_connection_module(self):
self.assertIsInstance(LocalConnection(self.conn_info), LocalConnection) self.assertIsInstance(LocalConnection(self.conn_info, self.in_stream), LocalConnection)
# def test_paramiko_connection_module(self): def test_paramiko_connection_module(self):
# self.assertIsInstance(ParamikoConnection(self.conn_info), ParamikoConnection) self.assertIsInstance(ParamikoConnection(self.conn_info, self.in_stream), ParamikoConnection)
def test_ssh_connection_module(self): def test_ssh_connection_module(self):
self.assertIsInstance(SSHConnection(self.conn_info), SSHConnection) self.assertIsInstance(SSHConnection(self.conn_info, self.in_stream), SSHConnection)
# def test_winrm_connection_module(self): # def test_winrm_connection_module(self):
# self.assertIsInstance(WinRmConnection(), WinRmConnection) # self.assertIsInstance(WinRmConnection(), WinRmConnection)