/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 breezy/tests/per_repository/test_signatures.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-16 19:47:19 UTC
  • mfrom: (7178 work)
  • mto: This revision was merged to the branch mainline in revision 7179.
  • Revision ID: jelmer@jelmer.uk-20181116194719-m5ut2wfuze5x9s1p
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from breezy.testament import Testament
27
27
from breezy.tests import per_repository
28
28
 
 
29
 
29
30
class TestSignatures(per_repository.TestCaseWithRepository):
30
31
 
31
32
    def setUp(self):
48
49
        repo.start_write_group()
49
50
        repo.sign_revision(a, strategy)
50
51
        repo.commit_write_group()
51
 
        self.assertEqual(b'-----BEGIN PSEUDO-SIGNED CONTENT-----\n' +
52
 
                         Testament.from_revision(repo,
53
 
                         a).as_short_text() +
 
52
        self.assertEqual(b'-----BEGIN PSEUDO-SIGNED CONTENT-----\n'
 
53
                         + Testament.from_revision(repo,
 
54
                                                   a).as_short_text() +
54
55
                         b'-----END PSEUDO-SIGNED CONTENT-----\n',
55
56
                         repo.get_signature_text(a))
56
57
 
94
95
        repo.sign_revision(a, gpg.LoopbackGPGStrategy(None))
95
96
        repo.commit_write_group()
96
97
        repo.unlock()
97
 
        #FIXME: clone should work to urls,
 
98
        # FIXME: clone should work to urls,
98
99
        # wt.clone should work to disks.
99
100
        self.build_tree(['target/'])
100
101
        d2 = repo.controldir.clone(urlutils.local_path_to_url('target'))
118
119
        repo.start_write_group()
119
120
        repo.sign_revision(a, strategy)
120
121
        repo.commit_write_group()
121
 
        self.assertEqual(b'-----BEGIN PSEUDO-SIGNED CONTENT-----\n' +
122
 
                         Testament.from_revision(repo, a).as_short_text() +
123
 
                         b'-----END PSEUDO-SIGNED CONTENT-----\n',
 
122
        self.assertEqual(b'-----BEGIN PSEUDO-SIGNED CONTENT-----\n'
 
123
                         + Testament.from_revision(repo, a).as_short_text()
 
124
                         + b'-----END PSEUDO-SIGNED CONTENT-----\n',
124
125
                         repo.get_signature_text(a))
125
126
        self.assertEqual(
126
127
            (gpg.SIGNATURE_VALID, None),
136
137
        repo.start_write_group()
137
138
        repo.sign_revision(a, strategy)
138
139
        repo.commit_write_group()
139
 
        self.assertEqual(b'-----BEGIN PSEUDO-SIGNED CONTENT-----\n' +
140
 
                         Testament.from_revision(repo, a).as_short_text() +
141
 
                         b'-----END PSEUDO-SIGNED CONTENT-----\n',
 
140
        self.assertEqual(b'-----BEGIN PSEUDO-SIGNED CONTENT-----\n'
 
141
                         + Testament.from_revision(repo, a).as_short_text()
 
142
                         + b'-----END PSEUDO-SIGNED CONTENT-----\n',
142
143
                         repo.get_signature_text(a))
143
144
        self.assertEqual(
144
145
            [(a, gpg.SIGNATURE_VALID, None),
158
159
        repo.lock_write()
159
160
        repo.start_write_group()
160
161
        self.assertRaises(errors.UnsupportedOperation,
161
 
            repo.sign_revision, a, gpg.LoopbackGPGStrategy(None))
 
162
                          repo.sign_revision, a, gpg.LoopbackGPGStrategy(None))
162
163
        repo.commit_write_group()