~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/test_signatures.py

  • Committer: Jelmer Vernooij
  • Date: 2011-11-15 17:22:02 UTC
  • mfrom: (6260 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6262.
  • Revision ID: jelmer@samba.org-20111115172202-inumr89vw3eo5ffg
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
class TestSignatures(per_repository.TestCaseWithRepository):
30
30
 
 
31
    def setUp(self):
 
32
        super(TestSignatures, self).setUp()
 
33
        if not self.repository_format.supports_revision_signatures:
 
34
            raise tests.TestNotApplicable(
 
35
                "repository does not support signing revisions")
 
36
 
31
37
# TODO 20051003 RBC:
32
38
# compare the gpg-to-sign info for a commit with a ghost and
33
39
#     an identical tree without a ghost
119
125
        self.assertEquals(
120
126
            (gpg.SIGNATURE_VALID, None, ),
121
127
            repo.verify_revision_signature('A', strategy))
 
128
 
 
129
 
 
130
class TestUnsupportedSignatures(per_repository.TestCaseWithRepository):
 
131
 
 
132
    def test_sign_revision(self):
 
133
        if self.repository_format.supports_revision_signatures:
 
134
            raise tests.TestNotApplicable(
 
135
                "repository supports signing revisions")
 
136
        wt = self.make_branch_and_tree('source')
 
137
        wt.commit('A', allow_pointless=True, rev_id='A')
 
138
        repo = wt.branch.repository
 
139
        repo.lock_write()
 
140
        repo.start_write_group()
 
141
        self.assertRaises(errors.UnsupportedOperation,
 
142
            repo.sign_revision, 'A', gpg.LoopbackGPGStrategy(None))
 
143
        repo.commit_write_group()