summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/git/test_repo.py8
-rw-r--r--test/git/test_tree.py2
2 files changed, 9 insertions, 1 deletions
diff --git a/test/git/test_repo.py b/test/git/test_repo.py
index df495e71..0b196a1f 100644
--- a/test/git/test_repo.py
+++ b/test/git/test_repo.py
@@ -38,6 +38,14 @@ class TestRepo(TestBase):
assert isinstance(self.rorepo.heads.master, Head)
assert isinstance(self.rorepo.heads['master'], Head)
+
+ def test_tree_from_revision(self):
+ tree = self.rorepo.tree('0.1.6')
+ assert tree.type == "tree"
+ assert self.rorepo.tree(tree) == tree
+
+ # try from invalid revision that does not exist
+ self.failUnlessRaises(ValueError, self.rorepo.tree, 'hello world')
@patch_object(Git, '_call_process')
def test_commits(self, git):
diff --git a/test/git/test_tree.py b/test/git/test_tree.py
index 7b66743f..e0c1f134 100644
--- a/test/git/test_tree.py
+++ b/test/git/test_tree.py
@@ -16,7 +16,7 @@ class TestTree(TestCase):
def test_traverse(self):
- root = self.repo.tree()
+ root = self.repo.tree('0.1.6')
num_recursive = 0
all_items = list()
for obj in root.traverse():