コード例 #1
0
ファイル: test_blobs_server.py プロジェクト: DarkDare/soledad
 def setUp(self):
     root = server_blobs.BlobsResource(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
コード例 #2
0
 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)
コード例 #3
0
 def setUp(self):
     root = Resource()
     state = BlobsServerState('filesystem', blobs_path=self.tempdir)
     incoming_resource = IncomingResource(state)
     blobs_resource = server_blobs.BlobsResource("filesystem", self.tempdir)
     root.putChild('blobs', blobs_resource)
     root.putChild('incoming', incoming_resource)
     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.blobs_uri = self.uri + 'blobs/'
     self.incoming_uri = self.uri + 'incoming'
     self.user_id = 'user-' + uuid4().hex
     self.secret = 'A' * 96
     self.blob_manager = BlobManager(self.tempdir, self.blobs_uri,
                                     self.secret, self.secret,
                                     self.user_id)
     self.box = IncomingBox(self.blob_manager, 'MX')
     self.loop = IncomingBoxProcessingLoop(self.box)
     # FIXME: We use blob_manager client only to avoid DelayedCalls
     # Somehow treq being used here keeps a connection pool open
     self.client = self.blob_manager._client
コード例 #4
0
 def setUp(self):
     self.resource = server_blobs.BlobsResource("filesystem", self.tempdir)