diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-11-26 18:16:13 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-11-26 18:16:13 +0100 |
commit | accfe361443b3cdb8ea43ca0ccb8fbb2fa202e12 (patch) | |
tree | a7786d8ac7fa5772506d9020f0221997991f1b28 /test/git/test_base.py | |
parent | 7ef66a66dc52dcdf44cebe435de80634e1beb268 (diff) | |
download | gitpython-accfe361443b3cdb8ea43ca0ccb8fbb2fa202e12.tar.gz |
tree: added traversal method, adjusted tests
Fixed critical bug in object code: IndexObjects now use their path as hashkey, not the data\!
Diffstat (limited to 'test/git/test_base.py')
-rw-r--r-- | test/git/test_base.py | 16 |
1 files changed, 10 insertions, 6 deletions
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 |