/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: 2019-05-29 03:22:34 UTC
  • mfrom: (7303 work)
  • mto: This revision was merged to the branch mainline in revision 7306.
  • Revision ID: jelmer@jelmer.uk-20190529032234-mt3fuws8gq03tapi
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    urlutils,
24
24
    )
25
25
from breezy.repository import WriteGroup
26
 
from breezy.testament import Testament
 
26
from breezy.bzr.testament import Testament
27
27
from breezy.tests import per_repository
28
28
 
29
29
 
49
49
        repo.start_write_group()
50
50
        repo.sign_revision(a, strategy)
51
51
        repo.commit_write_group()
52
 
        self.assertEqual(b'-----BEGIN PSEUDO-SIGNED CONTENT-----\n' +
53
 
                         Testament.from_revision(repo,
54
 
                         a).as_short_text() +
 
52
        self.assertEqual(b'-----BEGIN PSEUDO-SIGNED CONTENT-----\n'
 
53
                         + Testament.from_revision(repo,
 
54
                                                   a).as_short_text() +
55
55
                         b'-----END PSEUDO-SIGNED CONTENT-----\n',
56
56
                         repo.get_signature_text(a))
57
57
 
85
85
        repo.sign_revision(a, gpg.LoopbackGPGStrategy(None))
86
86
        repo.commit_write_group()
87
87
        repo.unlock()
88
 
        #FIXME: clone should work to urls,
 
88
        # FIXME: clone should work to urls,
89
89
        # wt.clone should work to disks.
90
90
        self.build_tree(['target/'])
91
91
        d2 = repo.controldir.clone(urlutils.local_path_to_url('target'))
109
109
        repo.start_write_group()
110
110
        repo.sign_revision(a, strategy)
111
111
        repo.commit_write_group()
112
 
        self.assertEqual(b'-----BEGIN PSEUDO-SIGNED CONTENT-----\n' +
113
 
                         Testament.from_revision(repo, a).as_short_text() +
114
 
                         b'-----END PSEUDO-SIGNED CONTENT-----\n',
 
112
        self.assertEqual(b'-----BEGIN PSEUDO-SIGNED CONTENT-----\n'
 
113
                         + Testament.from_revision(repo, a).as_short_text()
 
114
                         + b'-----END PSEUDO-SIGNED CONTENT-----\n',
115
115
                         repo.get_signature_text(a))
116
116
        self.assertEqual(
117
117
            (gpg.SIGNATURE_VALID, None),
127
127
        repo.start_write_group()
128
128
        repo.sign_revision(a, strategy)
129
129
        repo.commit_write_group()
130
 
        self.assertEqual(b'-----BEGIN PSEUDO-SIGNED CONTENT-----\n' +
131
 
                         Testament.from_revision(repo, a).as_short_text() +
132
 
                         b'-----END PSEUDO-SIGNED CONTENT-----\n',
 
130
        self.assertEqual(b'-----BEGIN PSEUDO-SIGNED CONTENT-----\n'
 
131
                         + Testament.from_revision(repo, a).as_short_text()
 
132
                         + b'-----END PSEUDO-SIGNED CONTENT-----\n',
133
133
                         repo.get_signature_text(a))
134
134
        self.assertEqual(
135
135
            [(a, gpg.SIGNATURE_VALID, None),
149
149
        repo.lock_write()
150
150
        repo.start_write_group()
151
151
        self.assertRaises(errors.UnsupportedOperation,
152
 
            repo.sign_revision, a, gpg.LoopbackGPGStrategy(None))
 
152
                          repo.sign_revision, a, gpg.LoopbackGPGStrategy(None))
153
153
        repo.commit_write_group()