~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2006-02-17 02:01:02 UTC
  • mto: (1185.50.81 bzr-jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: john@arbash-meinel.com-20060217020102-a26538d2b32bff80
cleanups from Robert

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
 
 
19
 
"""Black-box tests for bzr sign-my-commits.
20
 
"""
 
18
"""Black-box tests for bzr sign-my-commits."""
21
19
 
22
20
import os
23
21
 
24
22
import bzrlib.gpg
25
23
from bzrlib.testament import Testament
26
 
from bzrlib.tests import TestCaseInTempDir
 
24
from bzrlib.tests import TestCaseWithTransport
27
25
from bzrlib.workingtree import WorkingTree
28
26
 
29
27
 
30
 
class SignMyCommits(TestCaseInTempDir):
 
28
class SignMyCommits(TestCaseWithTransport):
31
29
 
32
30
    def monkey_patch_gpg(self):
33
31
        """Monkey patch the gpg signing strategy to be a loopback.
45
43
    def _fix_gpg_strategy(self):
46
44
        bzrlib.gpg.GPGStrategy = self._oldstrategy
47
45
 
48
 
    def setup_tree(self):
49
 
        wt = WorkingTree.create_standalone('.')
 
46
    def setup_tree(self, location='.'):
 
47
        wt = self.make_branch_and_tree(location)
50
48
        wt.commit("base A", allow_pointless=True, rev_id='A')
51
49
        wt.commit("base B", allow_pointless=True, rev_id='B')
52
50
        wt.commit("base C", allow_pointless=True, rev_id='C')
75
73
        self.assertFalse(repo.revision_store.has_id('D', 'sig'))
76
74
            
77
75
    def test_sign_my_commits_location(self):
78
 
        os.mkdir('other')
79
 
        os.chdir('other')
80
 
        wt = self.setup_tree()
 
76
        wt = self.setup_tree('other')
81
77
        repo = wt.branch.repository
82
 
        os.chdir('..')
83
78
 
84
79
        self.monkey_patch_gpg()
85
80