1
# Copyright (C) 2005 by Canonical Ltd
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
"""Test testaments for gpg signing."""
22
from bzrlib.selftest import TestCaseInTempDir
23
from bzrlib.branch import Branch
24
from bzrlib.testament import Testament
26
class TestamentTests(TestCaseInTempDir):
28
def test_null_testament(self):
29
"""Testament for a revision with no contents."""
30
b = Branch.initialize('.')
31
b.commit(message='initial null commit',
32
committer='test@user',
33
timestamp=1129025423, # 'Tue Oct 11 20:10:23 2005'
36
t = Testament.from_revision(b, 'test@user-1')
39
ass(isinstance(t, Testament))
40
eq(t.revision_id, 'test@user-1')
41
eq(t.committer, 'test@user')
42
eq(t.timestamp, 1129025423)