~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_gpg.py

  • Committer: Patch Queue Manager
  • Date: 2011-09-08 11:01:15 UTC
  • mfrom: (6123.1.16 gpg-typo)
  • Revision ID: pqm@cupuasso-20110908110115-gbb9benwkdksvzk5
(jelmer) Fix a typo (invalid format identifier) in an error message in
 bzrlib.gpg. (Jelmer Vernooij)

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 errors, ui
24
 
import bzrlib.gpg as gpg
25
 
from bzrlib.tests import TestCase
26
 
from bzrlib.tests import features
 
23
from bzrlib import (
 
24
    errors,
 
25
    gpg,
 
26
    trace,
 
27
    ui,
 
28
    )
 
29
from bzrlib.tests import (
 
30
    TestCase,
 
31
    features,
 
32
    )
27
33
 
28
34
class FakeConfig(object):
29
35
 
391
397
 
392
398
    def test_verify_invalid(self):
393
399
        self.requireFeature(features.gpgme)
 
400
        self.import_keys()
394
401
        content = """-----BEGIN PGP SIGNED MESSAGE-----
395
402
Hash: SHA1
396
403
 
415
422
 
416
423
    def test_verify_expired_but_valid(self):
417
424
        self.requireFeature(features.gpgme)
 
425
        self.import_keys()
418
426
        content = """-----BEGIN PGP SIGNED MESSAGE-----
419
427
Hash: SHA1
420
428
 
441
449
 
442
450
    def test_verify_unknown_key(self):
443
451
        self.requireFeature(features.gpgme)
 
452
        self.import_keys()
444
453
        content = """-----BEGIN PGP SIGNED MESSAGE-----
445
454
Hash: SHA1
446
455
 
473
482
    def test_set_acceptable_keys_unknown(self):
474
483
        self.requireFeature(features.gpgme)
475
484
        my_gpg = gpg.GPGStrategy(FakeConfig())
 
485
        self.notes = []
 
486
        def note(*args):
 
487
            self.notes.append(args[0] % args[1:])
 
488
        self.overrideAttr(trace, 'note', note)
476
489
        my_gpg.set_acceptable_keys("unknown")
477
490
        self.assertEqual(my_gpg.acceptable_keys, [])
 
491
        self.assertEqual(self.notes,
 
492
            ['No GnuPG key results for pattern: unknown'])
478
493
 
479
494
 
480
495
class TestDisabled(TestCase):