def setUp(self): root = server_blobs.BlobsResource("filesystem", self.tempdir) site = Site(root) self.port = reactor.listenTCP(0, site, interface='127.0.0.1') self.host = self.port.getHost() self.uri = 'http://%s:%s/' % (self.host.host, self.host.port) self.secret = 'A' * 96 set_global_pool(None)
def setUp(self): set_global_pool(None) pool_patcher = mock.patch('treq._utils.HTTPConnectionPool') self.HTTPConnectionPool = pool_patcher.start() self.addCleanup(pool_patcher.stop) self.reactor = mock.Mock()
def setUp(self): set_global_pool(None) client_patcher = mock.patch('treq.api.HTTPClient') self.HTTPClient = client_patcher.start() self.addCleanup(client_patcher.stop) pool_patcher = mock.patch('treq._utils.HTTPConnectionPool') self.HTTPConnectionPool = pool_patcher.start() self.addCleanup(pool_patcher.stop) self.client = self.HTTPClient.with_config.return_value
def setUp(self): client_blobs.sync.MAX_WAIT = 0.1 blobs_resource = server_blobs.BlobsResource("filesystem", self.tempdir) stream_resource = StreamingResource("filesystem", self.tempdir) root = Resource() root.putChild('blobs', blobs_resource) root.putChild('stream', stream_resource) self.site = Site(root) self.port = reactor.listenTCP(0, self.site, interface='127.0.0.1') self.host = self.port.getHost() self.uri = 'http://%s:%s/' % (self.host.host, self.host.port) self.stream_uri = urljoin(self.uri, 'stream/') self.uri = urljoin(self.uri, 'blobs/') self.secret = 'A' * 96 set_global_pool(None)
def setUp(self): set_global_pool(None) agent_patcher = mock.patch('treq.api.Agent') self.Agent = agent_patcher.start() self.addCleanup(agent_patcher.stop) client_patcher = mock.patch('treq.api.HTTPClient') self.HTTPClient = client_patcher.start() self.addCleanup(client_patcher.stop) pool_patcher = mock.patch('treq._utils.HTTPConnectionPool') self.HTTPConnectionPool = pool_patcher.start() self.addCleanup(pool_patcher.stop) self.client = self.HTTPClient.return_value