twisted.test.proto_helpers.MemoryReactor(object)
class documentationtwisted.test.proto_helpers
View Source
(View In Hierarchy)
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. |
listenTCP
). (type: list
)
listenSSL
). (type: list
)
connectUNIX
). (type: list
)
listenUNIX
). (type: list
)
adoptStreamConnection
.
Initialize the tracking lists.
Fake IReactorSocket.adoptStreamPort
,
that logs the call and returns an IListeningPort
.
Record the given stream connection in
adoptedStreamConnections
.
See Also | twisted.internet.interfaces.IReactorSocket.adoptStreamConnection |
Fake IReactorSocket.adoptDatagramPort
,
that logs the call and returns a fake IListeningPort
.
See Also | twisted.internet.interfaces.IReactorSocket.adoptDatagramPort |
Fake reactor.listenTCP
, that logs the call and returns an
IListeningPort
.
Fake reactor.connectTCP
, that logs the call and returns an
IConnector
.
Fake reactor.listenSSL
, that logs the call and returns an
IListeningPort
.
Fake reactor.connectSSL
, that logs the call and returns an
IConnector
.
Fake reactor.listenUNIX
, that logs the call and returns an
IListeningPort
.
Fake reactor.connectUNIX
, that logs the call and returns an
IConnector
.
Fake IReactorFDSet.addReader
which adds the reader to a local set.
Fake IReactorFDSet.removeReader
which removes the reader from a local set.
Fake IReactorFDSet.addWriter
which adds the writer to a local set.
Fake IReactorFDSet.removeWriter
which removes the writer from a local set.
Fake IReactorFDSet.getReaders
which returns a list of readers from the local set.
Fake IReactorFDSet.getWriters
which returns a list of writers from the local set.
Fake IReactorFDSet.removeAll
which removed all readers and writers from the local sets.