twisted.internet.test.test_core.SystemEventTestsBuilder(ReactorBuilder)
class documentationtwisted.internet.test.test_core
(View In Hierarchy)
Builder defining tests relating to IReactorCore.addSystemEventTrigger
and IReactorCore.fireSystemEvent
.
Method | test_stopWhenNotStarted | reactor.stop() raises RuntimeError
when called when the reactor has not been started. |
Method | test_stopWhenAlreadyStopped | reactor.stop() raises RuntimeError
when called after the reactor has been stopped. |
Method | test_callWhenRunningOrder | Functions are run in the order that they were passed to
reactor.callWhenRunning . |
Method | test_runningForStartupEvents | The reactor is not running when "before"
"startup" triggers are called and is running when
"during" and "after"
"startup" triggers are called. |
Method | test_signalHandlersInstalledDuringStartup | Signal handlers are installed in responsed to the
"during" "startup" . |
Method | test_stopShutDownEvents | reactor.stop() fires all three phases of shutdown event
triggers before it makes reactor.run() return. |
Method | test_shutdownFiresTriggersAsynchronously | "before" "shutdown"
triggers are not run synchronously from reactor.stop . |
Method | test_shutdownDisconnectsCleanly | A IFileDescriptor.connectionLost
implementation which raises an exception does not prevent the remaining IFileDescriptor s
from having their connectionLost method called. |
Method | test_multipleRun | reactor.run() raises ReactorAlreadyRunning
when called when the reactor is already running. |
Method | test_runWithAsynchronousBeforeStartupTrigger | When there is a 'before' 'startup' trigger
which returns an unfired Deferred ,
reactor.run() starts the reactor and does not return until
after reactor.stop() is called |
Method | test_iterate | reactor.iterate() does not block. |
Method | test_crash | reactor.crash() stops the reactor and does not fire
shutdown triggers. |
Method | test_runAfterCrash | reactor.run() restarts the reactor after it has been
stopped by reactor.crash() . |
Method | test_runAfterStop | reactor.run() raises ReactorNotRestartable
when called when the reactor is being run after getting stopped
priorly. |
Inherited from ReactorBuilder:
Class Variable | skippedReactors | A dict mapping FQPN strings of reactors for which the tests defined by this class will be skipped to strings giving the skip message. |
Class Variable | requiredInterfaces | A list of interfaces which the reactor must provide or these
tests will be skipped. The default, None ,
means that no interfaces are required. |
Instance Variable | reactorFactory | A no-argument callable which returns the reactor to use for testing. |
Instance Variable | originalHandler | The SIGCHLD handler which was installed when setUp ran and which will be re-installed when tearDown runs. |
Method | setUp | Clear the SIGCHLD handler, if there is one, to ensure an environment
like the one which exists prior to a call to reactor.run . |
Method | tearDown | Restore the original SIGCHLD handler and reap processes as long as there seem to be any remaining. |
Method | unbuildReactor | Clean up any resources which may have been allocated for the given reactor by its creation or by a test which used it. |
Method | buildReactor | Create and return a reactor using self.reactorFactory . |
Method | getTimeout | Determine how long to run the test before considering it failed. |
Method | runReactor | Run the reactor for at most the given amount of time. |
Class Method | makeTestCaseClasses | Create a SynchronousTestCase
subclass which mixes in cls for each known reactor and return
a dict mapping their names to them. |
Instance Variable | _reactors | A list of FQPN strings giving the reactors for which SynchronousTestCase s
will be created. |
reactor.stop()
raises RuntimeError
when called when the reactor has not been started.
reactor.stop()
raises RuntimeError
when called after the reactor has been stopped.
Functions are run in the order that they were passed to
reactor.callWhenRunning
.
The reactor is not running when "before"
"startup"
triggers are called and is running when
"during"
and "after"
"startup"
triggers are called.
Signal handlers are installed in responsed to the
"during"
"startup"
.
reactor.stop()
fires all three phases of shutdown event
triggers before it makes reactor.run()
return.
"before"
"shutdown"
triggers are not run synchronously from reactor.stop
.
A IFileDescriptor.connectionLost
implementation which raises an exception does not prevent the remaining IFileDescriptor
s
from having their connectionLost
method called.
reactor.run()
raises ReactorAlreadyRunning
when called when the reactor is already running.
When there is a 'before'
'startup'
trigger
which returns an unfired Deferred
,
reactor.run()
starts the reactor and does not return until
after reactor.stop()
is called
reactor.run()
restarts the reactor after it has been
stopped by reactor.crash()
.
reactor.run()
raises ReactorNotRestartable
when called when the reactor is being run after getting stopped
priorly.