summaryrefslogtreecommitdiff
path: root/test/git/test_index.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-11-26 18:16:13 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-11-26 18:16:13 +0100
commitaccfe361443b3cdb8ea43ca0ccb8fbb2fa202e12 (patch)
treea7786d8ac7fa5772506d9020f0221997991f1b28 /test/git/test_index.py
parent7ef66a66dc52dcdf44cebe435de80634e1beb268 (diff)
downloadgitpython-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_index.py')
-rw-r--r--test/git/test_index.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/git/test_index.py b/test/git/test_index.py
index e6e23ba7..2f4da161 100644
--- a/test/git/test_index.py
+++ b/test/git/test_index.py
@@ -83,11 +83,16 @@ class TestTree(TestBase):
tree = self.rorepo.commit(tree).tree
num_blobs = 0
- for blob in tree.traverse(predicate = lambda e: e.type == "blob"):
+ blist = list()
+ for blob in tree.traverse(predicate = lambda e: e.type == "blob", branch_first=False):
assert (blob.path,0) in index.entries
- num_blobs += 1
+ blist.append(blob)
# END for each blob in tree
- assert num_blobs == len(index.entries)
+ if len(blist) != len(index.entries):
+ iset = set(k[0] for k in index.entries.keys())
+ bset = set(b.path for b in blist)
+ raise AssertionError( "CMP Failed: Missing entries in index: %s, missing in tree: %s" % (bset-iset, iset-bset) )
+ # END assertion message
def test_index_file_from_tree(self):
common_ancestor_sha = "5117c9c8a4d3af19a9958677e45cda9269de1541"