/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_sign_my_commits.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:
19
19
 
20
20
import os
21
21
 
22
 
import bzrlib.gpg
 
22
from bzrlib import (
 
23
    gpg,
 
24
    tests,
 
25
    )
23
26
from bzrlib.testament import Testament
24
 
from bzrlib.tests import TestCaseWithTransport
25
27
from bzrlib.workingtree import WorkingTree
26
28
 
27
29
 
28
 
class SignMyCommits(TestCaseWithTransport):
 
30
class SignMyCommits(tests.TestCaseWithTransport):
29
31
 
30
32
    def monkey_patch_gpg(self):
31
33
        """Monkey patch the gpg signing strategy to be a loopback.
33
35
        This also registers the cleanup, so that we will revert to
34
36
        the original gpg strategy when done.
35
37
        """
36
 
        self.addAttrCleanup(bzrlib.gpg, 'GPGStrategy')
37
38
        # monkey patch gpg signing mechanism
38
 
        bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
 
39
        self.overrideAttr(gpg, 'GPGStrategy', gpg.LoopbackGPGStrategy)
39
40
 
40
41
    def setup_tree(self, location='.'):
41
42
        wt = self.make_branch_and_tree(location)