~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2010-01-25 17:48:22 UTC
  • mto: (4987.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4988.
  • Revision ID: v.ladeuil+lp@free.fr-20100125174822-nce4l19sbwx83jvq
Deploying the new overrideAttr facility further reduces the complexity
and make the code clearer.

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.addAttrCleanup(bzrlib.gpg, 'GPGStrategy')
39
40
        # monkey patch gpg signing mechanism
40
 
        bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
 
41
        self.overrideAttr(gpg, 'GPGStrategy', gpg.LoopbackGPGStrategy)
41
42
 
42
43
    def setup_tree(self):
43
44
        wt = BzrDir.create_standalone_workingtree('.')