def connected(protocol): if not ITLSTransport.providedBy(protocol.transport): results.append("skip") else: results.append(self.assertRaises(ValueError, protocol.transport.startTLS, brokenFactory))
def connected(protocol): if not ITLSTransport.providedBy(protocol.transport): results.append("skip") else: results.append(self.assertRaises(ValueError, protocol.transport.startTLS, brokenFactory))
def connectionMade(self): if not ITLSTransport.providedBy(self.transport): # Functionality isn't available to be tested. finished = self.factory.finished self.factory.finished = None finished.errback(SkipTest("No ITLSTransport support")) return # Switch the transport to TLS. self.transport.startTLS(self.factory.context) # Force TLS to really get negotiated. If nobody talks, nothing # will happen. self.transport.write("x")
def connectionMade(self): if not ITLSTransport.providedBy(self.transport): # Functionality isn't available to be tested. finished = self.factory.finished self.factory.finished = None finished.errback(SkipTest("No ITLSTransport support")) return # Switch the transport to TLS. self.transport.startTLS(self.factory.context) # Force TLS to really get negotiated. If nobody talks, nothing # will happen. self.transport.write("x")
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.ssh.agent}. """ import struct from twisted.internet import reactor from twisted.internet.interfaces import ITLSTransport from twisted.trial import unittest if not ITLSTransport.providedBy(reactor): iosim = None else: from twisted.test import iosim try: import Crypto.Cipher.DES3 except ImportError: Crypto = None try: import pyasn1 except ImportError: pyasn1 = None if Crypto and pyasn1: from twisted.conch.ssh import keys, agent else:
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.ssh.agent}. """ import struct from twisted.internet import reactor from twisted.internet.interfaces import ITLSTransport from twisted.trial import unittest if not ITLSTransport.providedBy(reactor): iosim = None else: from twisted.test import iosim try: import Crypto.Cipher.DES3 except ImportError: Crypto = None try: import pyasn1 except ImportError: pyasn1 = None if Crypto and pyasn1: from twisted.conch.ssh import keys, agent else: keys = agent = None