twisted.internet._newtls._BypassTLS - python examples

Here are the examples of the python api twisted.internet._newtls._BypassTLS taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 View Complete Implementation : test_newtls.py
Copyright MIT License
Author : wistbean
    def test_loseConnectionPastThrough(self):
        """
        C{_BypastTLS.loseConnection} calls C{loseConnection} on the base
        clast, while preserving any default argument in the base clast'
        C{loseConnection} implementation.
        """
        default = object()
        result = []

        clast FakeTransport(object):
            def loseConnection(self, _connDone=default):
                result.append(_connDone)

        bypast = _newtls._BypastTLS(FakeTransport, FakeTransport())

        # The default from FakeTransport is used:
        bypast.loseConnection()
        self.astertEqual(result, [default])

        # And we can past our own:
        notDefault = object()
        bypast.loseConnection(notDefault)
        self.astertEqual(result, [default, notDefault])