/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/test_gpg.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
# import system imports here
21
21
import sys
22
22
 
23
 
from bzrlib import (
 
23
from .. import (
24
24
    config,
25
25
    errors,
26
26
    gpg,
28
28
    trace,
29
29
    ui,
30
30
    )
31
 
from bzrlib.tests import (
 
31
from ..sixish import (
 
32
    BytesIO,
 
33
    )
 
34
from . import (
32
35
    TestCase,
33
36
    features,
34
37
    )
120
123
class TestVerify(TestCase):
121
124
 
122
125
    def import_keys(self):
123
 
        from StringIO import StringIO
124
126
        import gpgme
125
127
        context = gpgme.Context()
126
128
 
127
 
        key = StringIO("""-----BEGIN PGP PUBLIC KEY BLOCK-----
 
129
        key = BytesIO(b"""-----BEGIN PGP PUBLIC KEY BLOCK-----
128
130
Version: GnuPG v1.4.11 (GNU/Linux)
129
131
 
130
132
mQENBE343IgBCADwzPW7kmKb2bjB+UU+1ER/ABMZspvtoZMPusUw7bk6coXHF/0W
156
158
-----END PGP PUBLIC KEY BLOCK-----
157
159
""")
158
160
 
159
 
        secret_key = StringIO("""-----BEGIN PGP PRIVATE KEY BLOCK-----
 
161
        secret_key = BytesIO(b"""-----BEGIN PGP PRIVATE KEY BLOCK-----
160
162
Version: GnuPG v1.4.11 (GNU/Linux)
161
163
 
162
164
lQOYBE343IgBCADwzPW7kmKb2bjB+UU+1ER/ABMZspvtoZMPusUw7bk6coXHF/0W
215
217
-----END PGP PRIVATE KEY BLOCK-----
216
218
""")
217
219
 
218
 
        revoked_key = StringIO("""-----BEGIN PGP PUBLIC KEY BLOCK-----
 
220
        revoked_key = BytesIO(b"""-----BEGIN PGP PUBLIC KEY BLOCK-----
219
221
Version: GnuPG v1.4.11 (GNU/Linux)
220
222
 
221
223
mI0ETjlW5gEEAOb/6P+TVM59E897wRtatxys2BhsHCXM4T7xjIiANfDwejDdifqh
240
242
-----END PGP PUBLIC KEY BLOCK-----
241
243
""")
242
244
 
243
 
        expired_key = StringIO("""-----BEGIN PGP PUBLIC KEY BLOCK-----
 
245
        expired_key = BytesIO(b"""-----BEGIN PGP PUBLIC KEY BLOCK-----
244
246
Version: GnuPG v1.4.11 (GNU/Linux)
245
247
 
246
248
mI0ETjZ6PAEEALkR4GcFQidCCxV7pgQwQd5MZua0YO2l92fVqHX+PhnZ6egCLKdD