def test_pack(odb): odb, path = odb pack = OdbBackendPack(path) assert len(list(pack)) > 0 for obj in pack: assert obj in odb
def setUp(self): super().setUp() odb = Odb() object_path = os.path.join(self.repo.path, 'objects') odb.add_backend(OdbBackendPack(os.path.join(object_path, 'pack')), 1) odb.add_backend(OdbBackendLoose(object_path, 0, False), 1) refdb = Refdb.new(self.repo) refdb.set_backend(RefdbFsBackend(self.repo)) self.test_repo = pygit2.Repository() self.test_repo.set_odb(odb) self.test_repo.set_refdb(refdb)
def test_pack(self): pack = OdbBackendPack(self.obj_path) assert len(list(pack)) > 0 for obj in pack: assert obj in self.ref_odb
def proxy(barerepo): path = os.path.join(os.path.dirname(__file__), 'data', 'testrepo.git', 'objects') yield ProxyBackend(OdbBackendPack(path))
def setUp(self): super().setUp() self.obj_path = os.path.join(os.path.dirname(__file__), 'data', 'testrepo.git', 'objects') self.odb = ProxyBackend(OdbBackendPack(self.obj_path))