diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-11-23 12:35:34 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-11-23 12:35:59 +0100 |
commit | 6e5aae2fc8c3832bdae1cd5e0a269405fb059231 (patch) | |
tree | 0436d71c5f99eb004acf95604edcecd040cd2724 /test/test_reflog.py | |
parent | 739fa140235cc9d65c632eaf1f5cacc944d87cfb (diff) | |
download | gitpython-6e5aae2fc8c3832bdae1cd5e0a269405fb059231.tar.gz |
Initial interface including some of the implementation of the RefLog. TestCase scetched out for now
tests: Added tests to verify that objects don't have a dict. Previously, due to a missing __slots__ member in Serializable, most objects would indeed have a dict, although the opposite was intended
Diffstat (limited to 'test/test_reflog.py')
-rw-r--r-- | test/test_reflog.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/test_reflog.py b/test/test_reflog.py new file mode 100644 index 00000000..efcc7f33 --- /dev/null +++ b/test/test_reflog.py @@ -0,0 +1,32 @@ +from git.test.lib import * +from git.objects import IndexObject, Actor +from git.refs import * + +class TestRefLog(TestBase): + + def test_reflogentry(self): + nullhexsha = IndexObject.NULL_HEX_SHA + hexsha = 'F' * 40 + actor = Actor('name', 'email') + msg = "message" + + self.failUnlessRaises(ValueError, RefLogEntry.new, nullhexsha, hexsha, 'noactor', 0, 0, "") + e = RefLogEntry.new(nullhexsha, hexsha, actor, 0, 1, msg) + + assert e.oldhexsha == nullhexsha + assert e.newhexsha == hexsha + assert e.actor == actor + assert e.time[0] == 0 + assert e.time[1] == 1 + assert e.message == msg + + # check representation (roughly) + assert repr(e).startswith(nullhexsha) + + def test_base(self): + pass + # raise on invalid revlog + # TODO: Try multiple corrupted ones ! + + + # test serialize and deserialize - results must match exactly |