Known subclasses: twisted.test.proto_helpers.MemoryReactorClock

Implements interfaces: twisted.internet.interfaces.IReactorFDSet, twisted.internet.interfaces.IReactorSocket, twisted.internet.interfaces.IReactorSSL, twisted.internet.interfaces.IReactorTCP, twisted.internet.interfaces.IReactorUNIX

A fake reactor to be used in tests. This reactor doesn't actually do much that's useful yet. It accepts TCP connection setup attempts, but they will never succeed.

Instance Variable tcpClients a list that keeps track of connection attempts (ie, calls to connectTCP). (type: list)
Instance Variable tcpServers a list that keeps track of server listen attempts (ie, calls to listenTCP). (type: list)
Instance Variable sslClients a list that keeps track of connection attempts (ie, calls to connectSSL). (type: list)
Instance Variable sslServers a list that keeps track of server listen attempts (ie, calls to listenSSL). (type: list)
Instance Variable unixClients a list that keeps track of connection attempts (ie, calls to connectUNIX). (type: list)
Instance Variable unixServers a list that keeps track of server listen attempts (ie, calls to listenUNIX). (type: list)
Instance Variable adoptedPorts a list that keeps track of server listen attempts (ie, calls to adoptStreamPort).
Instance Variable adoptedStreamConnections a list that keeps track of stream-oriented connections added using adoptStreamConnection.
Method __init__ Initialize the tracking lists.
Method adoptStreamPort Fake IReactorSocket.adoptStreamPort, that logs the call and returns an IListeningPort.
Method adoptStreamConnection Record the given stream connection in adoptedStreamConnections.
Method adoptDatagramPort Fake IReactorSocket.adoptDatagramPort, that logs the call and returns a fake IListeningPort.
Method listenTCP Fake reactor.listenTCP, that logs the call and returns an IListeningPort.
Method connectTCP Fake reactor.connectTCP, that logs the call and returns an IConnector.
Method listenSSL Fake reactor.listenSSL, that logs the call and returns an IListeningPort.
Method connectSSL Fake reactor.connectSSL, that logs the call and returns an IConnector.
Method listenUNIX Fake reactor.listenUNIX, that logs the call and returns an IListeningPort.
Method connectUNIX Fake reactor.connectUNIX, that logs the call and returns an IConnector.
Method addReader Fake IReactorFDSet.addReader which adds the reader to a local set.
Method removeReader Fake IReactorFDSet.removeReader which removes the reader from a local set.
Method addWriter Fake IReactorFDSet.addWriter which adds the writer to a local set.
Method removeWriter Fake IReactorFDSet.removeWriter which removes the writer from a local set.
Method getReaders Fake IReactorFDSet.getReaders which returns a list of readers from the local set.
Method getWriters Fake IReactorFDSet.getWriters which returns a list of writers from the local set.
Method removeAll Fake IReactorFDSet.removeAll which removed all readers and writers from the local sets.
tcpClients =
a list that keeps track of connection attempts (ie, calls to connectTCP). (type: list)
tcpServers =
a list that keeps track of server listen attempts (ie, calls to listenTCP). (type: list)
sslClients =
a list that keeps track of connection attempts (ie, calls to connectSSL). (type: list)
sslServers =
a list that keeps track of server listen attempts (ie, calls to listenSSL). (type: list)
unixClients =
a list that keeps track of connection attempts (ie, calls to connectUNIX). (type: list)
unixServers =
a list that keeps track of server listen attempts (ie, calls to listenUNIX). (type: list)
adoptedPorts =
a list that keeps track of server listen attempts (ie, calls to adoptStreamPort).
adoptedStreamConnections =
a list that keeps track of stream-oriented connections added using adoptStreamConnection.
def __init__(self): (source)

Initialize the tracking lists.

def adoptStreamPort(self, fileno, addressFamily, factory): (source)
def adoptStreamConnection(self, fileDescriptor, addressFamily, factory): (source)

Record the given stream connection in adoptedStreamConnections.

See Alsotwisted.internet.interfaces.IReactorSocket.adoptStreamConnection
def adoptDatagramPort(self, fileno, addressFamily, protocol, maxPacketSize=8192): (source)
def listenTCP(self, port, factory, backlog=50, interface=''): (source)

Fake reactor.listenTCP, that logs the call and returns an IListeningPort.

def connectTCP(self, host, port, factory, timeout=30, bindAddress=None): (source)

Fake reactor.connectTCP, that logs the call and returns an IConnector.

def listenSSL(self, port, factory, contextFactory, backlog=50, interface=''): (source)

Fake reactor.listenSSL, that logs the call and returns an IListeningPort.

def connectSSL(self, host, port, factory, contextFactory, timeout=30, bindAddress=None): (source)

Fake reactor.connectSSL, that logs the call and returns an IConnector.

def listenUNIX(self, address, factory, backlog=50, mode=438, wantPID=0): (source)

Fake reactor.listenUNIX, that logs the call and returns an IListeningPort.

def connectUNIX(self, address, factory, timeout=30, checkPID=0): (source)

Fake reactor.connectUNIX, that logs the call and returns an IConnector.

def addReader(self, reader): (source)

Fake IReactorFDSet.addReader which adds the reader to a local set.

def removeReader(self, reader): (source)

Fake IReactorFDSet.removeReader which removes the reader from a local set.

def addWriter(self, writer): (source)

Fake IReactorFDSet.addWriter which adds the writer to a local set.

def removeWriter(self, writer): (source)

Fake IReactorFDSet.removeWriter which removes the writer from a local set.

def getReaders(self): (source)

Fake IReactorFDSet.getReaders which returns a list of readers from the local set.

def getWriters(self): (source)

Fake IReactorFDSet.getWriters which returns a list of writers from the local set.

def removeAll(self): (source)

Fake IReactorFDSet.removeAll which removed all readers and writers from the local sets.

API Documentation for Twisted, generated by pydoctor at 2016-04-11 10:39:53.