summaryrefslogtreecommitdiff
path: root/test/git/test_refs.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-05-10 19:32:45 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-05-10 19:32:51 +0200
commit837c32ba7ff2a3aa566a3b8e1330e3db0b4841d8 (patch)
treebecab82b67846625c68815aba91cd52eac3405b7 /test/git/test_refs.py
parent63761f4cb6f3017c6076ecd826ed0addcfb03061 (diff)
downloadgitpython-837c32ba7ff2a3aa566a3b8e1330e3db0b4841d8.tar.gz
repo: added test with some basic assertions for empty repositories these
repo.is_dirty: Will not fail on empty repo ( anymore ) index.entries: will just be empty if the repository is empty refs: added to_full_path method which can be used to create fully synthetic instances of Reference types, added a test for it Converted all touched files to spaces, which is why git reports so many changed files. Actually I was thinking every file would use spaces, but apparently not
Diffstat (limited to 'test/git/test_refs.py')
-rw-r--r--test/git/test_refs.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/git/test_refs.py b/test/git/test_refs.py
index 3d85356f..58a51f4a 100644
--- a/test/git/test_refs.py
+++ b/test/git/test_refs.py
@@ -14,6 +14,16 @@ import os
class TestRefs(TestBase):
+ def test_from_path(self):
+ # should be able to create any reference directly
+ for ref_type in ( Reference, Head, TagReference, RemoteReference ):
+ for name in ('rela_name', 'path/rela_name'):
+ full_path = ref_type.to_full_path(name)
+ instance = ref_type.from_path(self.rorepo, full_path)
+ assert isinstance(instance, ref_type)
+ # END for each name
+ # END for each type
+
def test_tag_base(self):
tag_object_refs = list()
for tag in self.rorepo.tags: