/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_re_sign.py

  • Committer: Robert Collins
  • Date: 2008-08-20 02:07:36 UTC
  • mfrom: (3640 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3682.
  • Revision ID: robertc@robertcollins.net-20080820020736-g2xe4921zzxtymle
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 by Canonical Ltd
 
1
# Copyright (C) 2005 Canonical Ltd
2
2
# -*- coding: utf-8 -*-
3
 
 
 
3
#
4
4
# This program is free software; you can redistribute it and/or modify
5
5
# it under the terms of the GNU General Public License as published by
6
6
# the Free Software Foundation; either version 2 of the License, or
7
7
# (at your option) any later version.
8
 
 
 
8
#
9
9
# This program is distributed in the hope that it will be useful,
10
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
12
# GNU General Public License for more details.
13
 
 
 
13
#
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
56
56
    def assertEqualSignature(self, repo, revision_id):
57
57
        """Assert a signature is stored correctly in repository."""
58
58
        self.assertEqual(
59
 
            Testament.from_revision(repo, revision_id).as_short_text(),
 
59
            '-----BEGIN PSEUDO-SIGNED CONTENT-----\n' +
 
60
            Testament.from_revision(repo, revision_id).as_short_text() +
 
61
            '-----END PSEUDO-SIGNED CONTENT-----\n',
60
62
            repo.get_signature_text(revision_id))
61
63
 
62
64
    def test_resign(self):
65
67
        repo = wt.branch.repository
66
68
 
67
69
        self.monkey_patch_gpg()
68
 
        self.run_bzr('re-sign', '-r', 'revid:A')
 
70
        self.run_bzr('re-sign -r revid:A')
69
71
 
70
72
        self.assertEqualSignature(repo, 'A')
71
73
 
72
 
        self.run_bzr('re-sign', 'B')
 
74
        self.run_bzr('re-sign B')
73
75
        self.assertEqualSignature(repo, 'B')
74
76
            
75
77
    def test_resign_range(self):
77
79
        repo = wt.branch.repository
78
80
 
79
81
        self.monkey_patch_gpg()
80
 
        self.run_bzr('re-sign', '-r', '1..')
 
82
        self.run_bzr('re-sign -r 1..')
81
83
        self.assertEqualSignature(repo, 'A')
82
84
        self.assertEqualSignature(repo, 'B')
83
85
        self.assertEqualSignature(repo, 'C')
87
89
        repo = wt.branch.repository
88
90
 
89
91
        self.monkey_patch_gpg()
90
 
        self.run_bzr('re-sign', 'A', 'B', 'C')
 
92
        self.run_bzr('re-sign A B C')
91
93
        self.assertEqualSignature(repo, 'A')
92
94
        self.assertEqualSignature(repo, 'B')
93
95
        self.assertEqualSignature(repo, 'C')