From 837c32ba7ff2a3aa566a3b8e1330e3db0b4841d8 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 10 May 2010 19:32:45 +0200 Subject: 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 --- test/git/test_refs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/git/test_refs.py') 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: -- cgit v1.2.1