~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

  • Committer: Robert Collins
  • Date: 2005-10-17 10:50:39 UTC
  • mto: This revision was merged to the branch mainline in revision 1459.
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051017105039-87b9e081c41cb906
Add re-sign command to generate a digital signature on a single revision.

Show diffs side-by-side

added added

removed removed

Lines of Context:
511
511
        self.runbzr('commit -m conflicts')
512
512
        self.assertEquals(result, "")
513
513
 
 
514
    def test_resign(self):
 
515
        """Test re signing of data."""
 
516
        import bzrlib.gpg
 
517
        oldstrategy = bzrlib.gpg.GPGStrategy
 
518
        branch = Branch.initialize('.')
 
519
        branch.commit("base", allow_pointless=True, rev_id='A')
 
520
        try:
 
521
            # monkey patch gpg signing mechanism
 
522
            from bzrlib.testament import Testament
 
523
            bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
 
524
            self.runbzr('re-sign -r revid:A')
 
525
            self.assertEqual(Testament.from_revision(branch,'A').as_short_text(),
 
526
                             branch.revision_store.get('A', 'sig').read())
 
527
        finally:
 
528
            bzrlib.gpg.GPGStrategy = oldstrategy
 
529
 
514
530
def listdir_sorted(dir):
515
531
    L = os.listdir(dir)
516
532
    L.sort()