~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_re_sign.py

  • Committer: Robert Collins
  • Date: 2010-04-08 04:34:03 UTC
  • mfrom: (5138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5139.
  • Revision ID: robertc@robertcollins.net-20100408043403-56z0d07vdqrx7f3t
Update bugfix for 528114 to trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
import os
23
23
 
24
 
import bzrlib.gpg
 
24
from bzrlib import (
 
25
    gpg,
 
26
    tests,
 
27
    )
25
28
from bzrlib.bzrdir import BzrDir
26
29
from bzrlib.testament import Testament
27
 
from bzrlib.tests import TestCaseInTempDir
28
 
 
29
 
 
30
 
class ReSign(TestCaseInTempDir):
 
30
 
 
31
 
 
32
class ReSign(tests.TestCaseInTempDir):
31
33
 
32
34
    def monkey_patch_gpg(self):
33
35
        """Monkey patch the gpg signing strategy to be a loopback.
35
37
        This also registers the cleanup, so that we will revert to
36
38
        the original gpg strategy when done.
37
39
        """
38
 
        self._oldstrategy = bzrlib.gpg.GPGStrategy
39
 
 
40
40
        # monkey patch gpg signing mechanism
41
 
        bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
42
 
 
43
 
        self.addCleanup(self._fix_gpg_strategy)
44
 
 
45
 
    def _fix_gpg_strategy(self):
46
 
        bzrlib.gpg.GPGStrategy = self._oldstrategy
 
41
        self.overrideAttr(gpg, 'GPGStrategy', gpg.LoopbackGPGStrategy)
47
42
 
48
43
    def setup_tree(self):
49
44
        wt = BzrDir.create_standalone_workingtree('.')