summaryrefslogtreecommitdiff
path: root/test/git/test_tree.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/git/test_tree.py')
-rw-r--r--test/git/test_tree.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/git/test_tree.py b/test/git/test_tree.py
index 64a7900a..7b66743f 100644
--- a/test/git/test_tree.py
+++ b/test/git/test_tree.py
@@ -4,6 +4,7 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
+import os
from test.testlib import *
from git import *
@@ -43,6 +44,19 @@ class TestTree(TestCase):
# trees and blobs
assert len(set(trees)|set(root.trees)) == len(trees)
assert len(set(b for b in root if isinstance(b, Blob)) | set(root.blobs)) == len( root.blobs )
+ subitem = trees[0][0]
+ assert "/" in subitem.path
+ assert subitem.name == os.path.basename(subitem.path)
+
+ # assure that at some point the traversed paths have a slash in them
+ found_slash = False
+ for item in root.traverse():
+ assert os.path.isabs(item.abspath)
+ if '/' in item.path:
+ found_slash = True
+ break
+ # END for each item
+ assert found_slash
def test_repr(self):
tree = Tree(self.repo, 'abc')