def get_version(self, filename, version=-1, **kwargs):
        # This is took from pymongo source. We need to go a little deeper here
        self._GridFS__files.ensure_index([("filename", ASCENDING),
                                          ("uploadDate", DESCENDING)])
        ########## Begin of MongoKit hack ##########
        cursor = self._GridFS__files.find(self._get_spec(filename=filename, **kwargs))
        ########## end of MongoKit hack ############
        if version < 0:
            skip = abs(version) - 1
            cursor.limit(-1).skip(skip).sort("uploadDate", DESCENDING)
        else:
            cursor.limit(-1).skip(version).sort("uploadDate", ASCENDING)
        try:
            grid_file = cursor.next()
            return GridOut(self._GridFS__collection, grid_file["_id"])
        except StopIteration:
            raise NoFile("no version %d for filename %r" % (version, filename))
Assert that GetDiskInfo returns None when given a wrong name.
dataset/ETHPy150Open namlook/mongokit/mongokit/grid.py/FS.get_version--crossover with--dataset/ETHPy150Open ganeti/ganeti/test/py/ganeti.config_unittest.py/TestConfigRunner.testDiskInfoByWrongName