def bundle_store(self): """ Returns the bundle store backing this CodaLab instance. The type of the store object depends on what the user has configured, but if no bundle store is configured manually then it defaults to a MultiDiskBundleStore. """ store_type = self.config.get('bundle_store', 'MultiDiskBundleStore') if store_type == MultiDiskBundleStore.__name__: return MultiDiskBundleStore(self.codalab_home) else: print >> sys.stderr, "Invalid bundle store type \"%s\"", store_type sys.exit(1)
def setUpClass(cls): cls.test_root = path_util.normalize("~/.codalab_tests") path_util.make_directory(cls.test_root) cls.bundle_store = MultiDiskBundleStore(cls.test_root) cls.model = SQLiteModel( "sqlite:///{}".format(os.path.join(cls.test_root, 'bundle.db')), {}) cls.model.root_user_id = '0' users = [ User('root', '0'), User('user1', '1'), User('user2', '2'), User('user4', '4') ] cls.auth_handler = MockAuthHandler(users) cls.client = LocalBundleClient('local', cls.bundle_store, cls.model, None, cls.auth_handler, verbose=1)