summaryrefslogtreecommitdiff
path: root/test/test_reflog.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_reflog.py')
-rw-r--r--test/test_reflog.py32
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