~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_gpg.py

  • Committer: Vincent Ladeuil
  • Date: 2011-10-31 22:11:59 UTC
  • mfrom: (6236 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6252.
  • Revision ID: v.ladeuil+lp@free.fr-20111031221159-zmbd6izz1flzyisa
Merge trunk before submission

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
 
476
482
    def test_set_acceptable_keys_unknown(self):
477
483
        self.requireFeature(features.gpgme)
478
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)
479
489
        my_gpg.set_acceptable_keys("unknown")
480
490
        self.assertEqual(my_gpg.acceptable_keys, [])
 
491
        self.assertEqual(self.notes,
 
492
            ['No GnuPG key results for pattern: unknown'])
481
493
 
482
494
 
483
495
class TestDisabled(TestCase):