autobahn.twisted.test.test_tx_choosereactor


Module Contents

Classes

ChooseReactorTests

A unit test. The atom of the unit testing universe.

class autobahn.twisted.test.test_tx_choosereactor.ChooseReactorTests(methodName='runTest')[source]

Bases: twisted.trial.unittest.TestCase

A unit test. The atom of the unit testing universe.

This class extends L{SynchronousTestCase} which extends C{unittest.TestCase} from the standard library. The main feature is the ability to return C{Deferred}s from tests and fixture methods and to have the suite wait for those C{Deferred}s to fire. Also provides new assertions such as L{assertFailure}.

@ivar timeout: A real number of seconds. If set, the test will raise an error if it takes longer than C{timeout} seconds. If not set, util.DEFAULT_TIMEOUT_DURATION is used.

patch_reactor(name, new_reactor)[source]

Patch name so that Twisted will grab a fake reactor instead of a real one.

patch_modules()[source]

Patch sys.modules so that Twisted believes there is no installed reactor.

test_unknown()[source]

install_optimal_reactor will use the default reactor if it is unable to detect the platform it is running on.

test_mac()[source]

install_optimal_reactor will install KQueueReactor on Darwin (OS X).

test_win()[source]

install_optimal_reactor will install IOCPReactor on Windows.

test_bsd()[source]

install_optimal_reactor will install KQueueReactor on BSD.

test_linux()[source]

install_optimal_reactor will install EPollReactor on Linux.