Ejemplo n.º 1
0
    def before(self):
        env.sync_cx.perftest.drop_collection('fs.files')
        env.sync_cx.perftest.drop_collection('fs.chunks')

        # Need new client that doesn't have GridFS indexes in its index cache.
        db = self.motor_client(ssl=self.ssl).perftest
        self.gridfs = motor_tornado.MotorGridFS(db)
Ejemplo n.º 2
0
    def setUp(self):
        super().setUp()

        sync_gridfs = GridFS(env.sync_cx.perftest)
        path = join(TEST_PATH, 'parallel', 'gridfs_multi')
        self.files = [join(path, s) for s in os.listdir(path)]

        for fname in self.files:
            with open(fname, 'rb') as gfile:
                sync_gridfs.put(gfile, filename=fname)

        self.gridfs = motor_tornado.MotorGridFS(self.cx.perftest)
Ejemplo n.º 3
0
    def setUp(self):
        super().setUp()
        self.gridfs = motor_tornado.MotorGridFS(self.cx.perftest)

        with open(gridfs_path, 'rb') as data:
            self.uploaded_id = GridFS(env.sync_cx.perftest).put(data)