Exemplo n.º 1
0
    def test_thin_from_file(self):
        test_sha = "1" * 40

        def resolve(sha):
            self.assertEqual(test_sha, sha)
            return 3, "data"

        path = os.path.join(self.datadir, "pack-%s.pack" % pack1_sha)
        data = ThinPackData.from_file(resolve, open(path), os.path.getsize(path))
        idx = self.get_pack_index(pack1_sha)
        Pack.from_objects(data, idx)
        self.assertEqual((None, 3, "data"), data.get_ref(test_sha))