diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-11-04 12:46:37 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-11-04 12:46:37 +0100 |
commit | c4cde8df886112ee32b0a09fcac90c28c85ded7f (patch) | |
tree | 3331b64af12952d4fb961e0db712192d990c548d /test/git/test_tree.py | |
parent | f9bbdc87a7263f479344fcf67c4b9fd6005bb6cd (diff) | |
download | gitpython-c4cde8df886112ee32b0a09fcac90c28c85ded7f.tar.gz |
IndexObject: assured that .path fields are relative to the repository ( previously it would just be a name )
added abspath property and name property to provide easy access to most common paths of an index object
Diffstat (limited to 'test/git/test_tree.py')
-rw-r--r-- | test/git/test_tree.py | 14 |
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') |