Skip to content

Commit

Permalink
git_pack: add some initial tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver authored and vstinner committed Jan 7, 2025
1 parent 776d0af commit b73c805
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,14 @@ def test_zlib_large_uncompressed_block(self):
self.checkValue(parser, "/data/compressed_block[1]/nlen", 27322)
self.checkValue(parser, "/data_checksum", 0xe85c1f89)

def test_git_pack(self):
parser = self.parse("pack-31c691f659cbc7841ca55a26a342fdaf0b89c533.pack")
self.checkValue(parser, "/version", 2)
self.checkValue(parser, "/num_objects", 7)
self.checkDesc(parser, "/object[0]", "type=OBJ_COMMIT, decompressed size=244")
# FIXME: also check parsing of objects (with sub-parsers)
self.checkValue(parser, "/checksum", 0x31c691f659cbc7841ca55a26a342fdaf0b89c533)


class TestParserRandomStream(unittest.TestCase):

Expand Down

0 comments on commit b73c805

Please sign in to comment.