From accfe361443b3cdb8ea43ca0ccb8fbb2fa202e12 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 26 Nov 2009 18:16:13 +0100 Subject: tree: added traversal method, adjusted tests Fixed critical bug in object code: IndexObjects now use their path as hashkey, not the data\! --- test/git/test_base.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'test/git/test_base.py') diff --git a/test/git/test_base.py b/test/git/test_base.py index 497f90fb..ab46ded4 100644 --- a/test/git/test_base.py +++ b/test/git/test_base.py @@ -16,10 +16,10 @@ import tempfile class TestBase(TestBase): - type_tuples = ( ("blob", "8741fc1d09d61f02ffd8cded15ff603eff1ec070"), - ("tree", "3a6a5e3eeed3723c09f1ef0399f81ed6b8d82e79"), - ("commit", "4251bd59fb8e11e40c40548cba38180a9536118c"), - ("tag", "e56a60e8e9cd333cfba0140a77cd12b0d9398f10") ) + type_tuples = ( ("blob", "8741fc1d09d61f02ffd8cded15ff603eff1ec070", "blob.py"), + ("tree", "3a6a5e3eeed3723c09f1ef0399f81ed6b8d82e79", "directory"), + ("commit", "4251bd59fb8e11e40c40548cba38180a9536118c", None), + ("tag", "e56a60e8e9cd333cfba0140a77cd12b0d9398f10", None) ) def test_base_object(self): # test interface of base object classes @@ -29,8 +29,12 @@ class TestBase(TestBase): s = set() num_objs = 0 num_index_objs = 0 - for obj_type, (typename, hexsha) in zip(types, self.type_tuples): - item = obj_type(self.rorepo,hexsha) + for obj_type, (typename, hexsha, path) in zip(types, self.type_tuples): + item = None + if path is None: + item = obj_type(self.rorepo,hexsha) + else: + item = obj_type(self.rorepo,hexsha, 0, path) num_objs += 1 assert item.sha == hexsha assert item.type == typename -- cgit v1.2.3