diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-11-04 13:17:37 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-11-04 13:17:37 +0100 |
commit | f41d42ee7e264ce2fc32cea555e5f666fa1b1fe9 (patch) | |
tree | 1d45b8f6fd8a6114b120e13844cc05e930793297 /test | |
parent | c4cde8df886112ee32b0a09fcac90c28c85ded7f (diff) | |
download | gitpython-f41d42ee7e264ce2fc32cea555e5f666fa1b1fe9.tar.gz |
Improved cmd error handling in case an invalid revision is specified for an object
repo.tree: improved to be less restricting
Diffstat (limited to 'test')
-rw-r--r-- | test/git/test_repo.py | 8 | ||||
-rw-r--r-- | test/git/test_tree.py | 2 |
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(): |