~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-24 08:37:32 UTC
  • Revision ID: robertc@robertcollins.net-20051024083732-7f99eeec70f2bbb8
BUGFIX: re-sign should accept ranges

Show diffs side-by-side

added added

removed removed

Lines of Context:
547
547
                             branch.revision_store.get('A', 'sig').read())
548
548
        finally:
549
549
            bzrlib.gpg.GPGStrategy = oldstrategy
 
550
            
 
551
    def test_resign_range(self):
 
552
        import bzrlib.gpg
 
553
        oldstrategy = bzrlib.gpg.GPGStrategy
 
554
        branch = Branch.initialize('.')
 
555
        branch.commit("base", allow_pointless=True, rev_id='A')
 
556
        branch.commit("base", allow_pointless=True, rev_id='B')
 
557
        branch.commit("base", allow_pointless=True, rev_id='C')
 
558
        try:
 
559
            # monkey patch gpg signing mechanism
 
560
            from bzrlib.testament import Testament
 
561
            bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
 
562
            self.runbzr('re-sign -r 1..')
 
563
            self.assertEqual(Testament.from_revision(branch,'A').as_short_text(),
 
564
                             branch.revision_store.get('A', 'sig').read())
 
565
            self.assertEqual(Testament.from_revision(branch,'B').as_short_text(),
 
566
                             branch.revision_store.get('B', 'sig').read())
 
567
            self.assertEqual(Testament.from_revision(branch,'C').as_short_text(),
 
568
                             branch.revision_store.get('C', 'sig').read())
 
569
        finally:
 
570
            bzrlib.gpg.GPGStrategy = oldstrategy
 
571
 
550
572
 
551
573
def listdir_sorted(dir):
552
574
    L = os.listdir(dir)