summaryrefslogtreecommitdiff
path: root/test/test_reflog.py
blob: efcc7f33a941e53bf32126a4199c56c323c0d0bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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