'L{Agent.usingEndpointFactory} creates an L{Agent} that uses the given
factory to create endpoints.'

def test_endpointFactory(self):

    factory = StubEndpointFactory()
    agent = client.Agent.usingEndpointFactory(None, endpointFactory=factory)
    uri = URI.fromBytes('http://example.com/')
    returnedEndpoint = agent._getEndpoint(uri)
    self.assertEqual(returnedEndpoint, ('http', 'example.com', 80))
