Known subclasses: twisted.web.test.test_agent.AgentHTTPSTests, twisted.web.test.test_agent.AgentMethodInjectionTests, twisted.web.test.test_agent.AgentTests, twisted.web.test.test_agent.AgentURIInjectionTests, twisted.web.test.test_agent.BrowserLikeRedirectAgentTests, twisted.web.test.test_agent.ContentDecoderAgentTests, twisted.web.test.test_agent.ContentDecoderAgentWithGzipTests, twisted.web.test.test_agent.CookieAgentTests, twisted.web.test.test_agent.HTTPConnectionPoolRetryTests, twisted.web.test.test_agent.HTTPConnectionPoolTests, twisted.web.test.test_agent.ProxyAgentTests, twisted.web.test.test_agent.RedirectAgentTests

A test mixin providing a testable Reactor class and a dummy connect method which allows instances to pretend to be endpoints.

Method createReactor Create a MemoryReactorClock and give it some hostnames it can resolve.
Class StubEndpoint Endpoint that wraps existing endpoint, substitutes StubHTTPProtocol, and resulting protocol instances are attached to the given test case.
Method buildAgentForWrapperTest Return an Agent suitable for use in tests that wrap the Agent and want both a fake reactor and StubHTTPProtocol.
Method connect Fake implementation of an endpoint which synchronously succeeds with an instance of StubHTTPProtocol for ease of testing.
def createReactor(self):

Create a MemoryReactorClock and give it some hostnames it can resolve.

Returnsa MemoryReactorClock-like object with a slightly limited interface (only advance and tcpClients in addition to its formally-declared reactor interfaces), which can resolve a fixed set of domains.
def buildAgentForWrapperTest(self, reactor):

Return an Agent suitable for use in tests that wrap the Agent and want both a fake reactor and StubHTTPProtocol.

def connect(self, factory):

Fake implementation of an endpoint which synchronously succeeds with an instance of StubHTTPProtocol for ease of testing.

API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.