summaryrefslogtreecommitdiff
path: root/test/git/test_refs.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-12-15 20:49:37 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-12-15 20:49:37 +0100
commitb1a2271a03313b561f5b786757feaded3d41b23f (patch)
tree3b1b0094e3a59dbb16c1aced3904c1ea74d14d10 /test/git/test_refs.py
parentbc66da0d66a9024f0bd86ada1c3cd4451acd8907 (diff)
downloadgitpython-b1a2271a03313b561f5b786757feaded3d41b23f.tar.gz
refs: Added is_valid method to SymbolicReference base class
Diffstat (limited to 'test/git/test_refs.py')
-rw-r--r--test/git/test_refs.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/git/test_refs.py b/test/git/test_refs.py
index 2cddf862..61c421fd 100644
--- a/test/git/test_refs.py
+++ b/test/git/test_refs.py
@@ -66,6 +66,12 @@ class TestRefs(TestBase):
types_found.add(type(ref))
assert len(types_found) == 3
+ def test_is_valid(self):
+ assert Reference(self.rorepo, 'refs/doesnt/exist').is_valid() == False
+ assert self.rorepo.head.is_valid()
+ assert self.rorepo.head.reference.is_valid()
+ assert SymbolicReference(self.rorepo, 'hellothere').is_valid() == False
+
@with_rw_repo('0.1.6')
def test_head_reset(self, rw_repo):
cur_head = rw_repo.head