Ticket #5521: required-interfaces.patch

File required-interfaces.patch, 5.6 KB (added by exarkun, 5 years ago)
  • twisted/internet/test/test_tcp.py

     
    2222from twisted.internet.error import ConnectionDone, ConnectionAborted
    2323from twisted.internet.interfaces import (
    2424    ILoggingContext, IResolverSimple, IConnector, IReactorFDSet,
    25     ITLSTransport)
     25    ITLSTransport, IReactorTCP)
    2626from twisted.internet.address import IPv4Address, IPv6Address
    2727from twisted.internet.defer import (
    2828    Deferred, DeferredList, succeed, fail, maybeDeferred, gatherResults)
     
    416416    """
    417417    Builder defining tests relating to L{IReactorTCP.connectTCP}.
    418418    """
     419    requiredInterfaces = (IReactorTCP,)
     420
    419421    def serverEndpoint(self, reactor):
    420422        """
    421423        Create a L{TCP4ServerEndpoint} listening on localhost on a
     
    740742    """
    741743    Tests for L{IReactorTCP.listenTCP}
    742744    """
     745    requiredInterfaces = (IReactorTCP,)
     746
    743747    def getListeningPort(self, reactor, factory):
    744748        """
    745749        Get a TCP port from a reactor.
     
    10641068    """
    10651069    Builder defining tests relating to L{twisted.internet.tcp.Connection}.
    10661070    """
     1071    requiredInterfaces = (IReactorTCP,)
     1072
    10671073    def test_stopStartReading(self):
    10681074        """
    10691075        This test verifies transport socket read state after multiple
     
    12131219    @ivar server: the listening server factory to be used in tests.
    12141220    @type server: L{MyServerFactory}
    12151221    """
     1222    requiredInterfaces = (IReactorTCP,)
     1223
    12161224    def setUp(self):
    12171225        server = MyServerFactory()
    12181226        server.protocolConnectionMade = Deferred()
     
    20382046    TCP-specific L{AbortConnectionMixin} tests.
    20392047    """
    20402048
     2049    requiredInterfaces = (IReactorTCP,)
     2050
    20412051    def listen(self, reactor, server):
    20422052        """
    20432053        Listen with the given protocol factory.
  • twisted/internet/test/test_threads.py

     
    1313from twisted.python.threadable import isInIOThread
    1414from twisted.internet.test.reactormixins import ReactorBuilder
    1515from twisted.python.threadpool import ThreadPool
     16from twisted.internet.interfaces import IReactorThreads
    1617
    1718
    1819class ThreadTestsBuilder(ReactorBuilder):
    1920    """
    2021    Builder for defining tests relating to L{IReactorThreads}.
    2122    """
     23    requiredInterfaces = (IReactorThreads,)
     24
    2225    def test_getThreadPool(self):
    2326        """
    2427        C{reactor.getThreadPool()} returns an instance of L{ThreadPool} which
  • twisted/internet/test/test_time.py

     
    99
    1010from twisted.python.runtime import platform
    1111from twisted.internet.test.reactormixins import ReactorBuilder
     12from twisted.internet.interfaces import IReactorTime
    1213
    1314
    1415class TimeTestsBuilder(ReactorBuilder):
    1516    """
    1617    Builder for defining tests relating to L{IReactorTime}.
    1718    """
     19    requiredInterfaces = (IReactorTime,)
     20
    1821    def test_delayedCallStopsReactor(self):
    1922        """
    2023        The reactor can be stopped by a delayed call.
     
    3033    Builder for defining tests relating to L{IReactorTime} for reactors based
    3134    off glib.
    3235    """
     36    requiredInterfaces = (IReactorTime,)
     37
    3338    if platform.isWindows():
    3439        _reactors = ["twisted.internet.gtk2reactor.PortableGtkReactor"]
    3540    else:
  • twisted/internet/test/test_udp.py

     
    1616from twisted.python.log import ILogContext, err
    1717from twisted.internet.test.reactormixins import ReactorBuilder
    1818from twisted.internet.defer import Deferred, maybeDeferred
    19 from twisted.internet.interfaces import ILoggingContext, IListeningPort
     19from twisted.internet.interfaces import (
     20    ILoggingContext, IListeningPort, IReactorUDP)
    2021from twisted.internet.address import IPv4Address
    2122from twisted.internet.protocol import DatagramProtocol
    2223
     
    133134    """
    134135    Builder defining tests relating to L{IReactorUDP.listenUDP}.
    135136    """
     137    requiredInterfaces = (IReactorUDP,)
     138
    136139    def test_interface(self):
    137140        """
    138141        L{IReactorUDP.listenUDP} returns an object providing L{IListeningPort}.
  • twisted/internet/test/test_unix.py

     
    6363    """
    6464    Builder defining tests relating to L{IReactorUNIX}.
    6565    """
     66    requiredInterfaces = (interfaces.IReactorUNIX,)
     67
    6668    def serverEndpoint(self, reactor):
    6769        """
    6870        Construct a UNIX server endpoint.
     
    132134    """
    133135    Builder defining tests relating to L{IReactorUNIXDatagram}.
    134136    """
     137    requiredInterfaces = (interfaces.IReactorUNIXDatagram,)
     138
    135139    # There's no corresponding test_connectMode because the mode parameter to
    136140    # connectUNIXDatagram has been completely ignored since that API was first
    137141    # introduced.
     
    164168    """
    165169    Tests for L{IReactorUNIX.listenUnix}
    166170    """
    167     requiredInterfaces = [interfaces.IReactorUNIX]
     171    requiredInterfaces = (interfaces.IReactorUNIX,)
    168172
    169173    def getListeningPort(self, reactor, factory):
    170174        """