Here are the examples of the python api twisted.conch.endpoints._ExistingConnectionHelper taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
3
Source : test_endpoints.py
with MIT License
from autofelix
with MIT License
from autofelix
def test_secureConnection(self):
"""
L{_ExistingConnectionHelper.secureConnection} returns a L{Deferred}
which fires with whatever object was fed to
L{_ExistingConnectionHelper.__init__}.
"""
result = object()
helper = _ExistingConnectionHelper(result)
self.assertIs(
result, self.successResultOf(helper.secureConnection()))
def test_cleanupConnectionNotImmediately(self):
3
Source : test_endpoints.py
with MIT License
from autofelix
with MIT License
from autofelix
def test_cleanupConnectionNotImmediately(self):
"""
L{_ExistingConnectionHelper.cleanupConnection} does nothing to the
existing connection if called with C{immediate} set to C{False}.
"""
helper = _ExistingConnectionHelper(object())
# Bit hard to test nothing happens. However, since object() has no
# relevant methods or attributes, if the code is incorrect we can
# expect an AttributeError.
helper.cleanupConnection(object(), False)
def test_cleanupConnectionImmediately(self):
3
Source : test_endpoints.py
with MIT License
from autofelix
with MIT License
from autofelix
def test_cleanupConnectionImmediately(self):
"""
L{_ExistingConnectionHelper.cleanupConnection} does nothing to the
existing connection if called with C{immediate} set to C{True}.
"""
helper = _ExistingConnectionHelper(object())
# Bit hard to test nothing happens. However, since object() has no
# relevant methods or attributes, if the code is incorrect we can
# expect an AttributeError.
helper.cleanupConnection(object(), True)
class _PTYPath(object):