126
126
(gpg.SIGNATURE_VALID, None, ),
127
127
repo.verify_revision_signature('A', strategy))
129
def test_verify_revision_signatures(self):
130
wt = self.make_branch_and_tree('.')
131
wt.commit("base", allow_pointless=True, rev_id='A')
132
wt.commit("second", allow_pointless=True, rev_id='B')
133
strategy = gpg.LoopbackGPGStrategy(None)
134
repo = wt.branch.repository
135
self.addCleanup(repo.lock_write().unlock)
136
repo.start_write_group()
137
repo.sign_revision('A', strategy)
138
repo.commit_write_group()
139
self.assertEqual('-----BEGIN PSEUDO-SIGNED CONTENT-----\n' +
140
Testament.from_revision(repo,
141
'A').as_short_text() +
142
'-----END PSEUDO-SIGNED CONTENT-----\n',
143
repo.get_signature_text('A'))
145
[('A', gpg.SIGNATURE_VALID, None),
146
('B', gpg.SIGNATURE_NOT_SIGNED, None)],
147
list(repo.verify_revision_signatures(['A', 'B'], strategy)))
130
150
class TestUnsupportedSignatures(per_repository.TestCaseWithRepository):