~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2006-02-14 17:01:48 UTC
  • mto: (1185.79.1 bzr-jam-pending)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: john@arbash-meinel.com-20060214170148-2765fe23e7309b93
Updating bzr re-sign to allow multiple arguments, and updating tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
814
814
        self.runbzr('commit -m conflicts')
815
815
        self.assertEquals(result, "")
816
816
 
817
 
    def test_resign(self):
818
 
        """Test re signing of data."""
819
 
        import bzrlib.gpg
820
 
        oldstrategy = bzrlib.gpg.GPGStrategy
821
 
        wt = WorkingTree.create_standalone('.')
822
 
        branch = wt.branch
823
 
        wt.commit("base", allow_pointless=True, rev_id='A')
824
 
        try:
825
 
            # monkey patch gpg signing mechanism
826
 
            from bzrlib.testament import Testament
827
 
            bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
828
 
            self.runbzr('re-sign -r revid:A')
829
 
            self.assertEqual(Testament.from_revision(branch.repository,
830
 
                             'A').as_short_text(),
831
 
                             branch.repository.revision_store.get('A', 
832
 
                             'sig').read())
833
 
        finally:
834
 
            bzrlib.gpg.GPGStrategy = oldstrategy
835
 
            
836
 
    def test_resign_range(self):
837
 
        import bzrlib.gpg
838
 
        oldstrategy = bzrlib.gpg.GPGStrategy
839
 
        wt = WorkingTree.create_standalone('.')
840
 
        branch = wt.branch
841
 
        wt.commit("base", allow_pointless=True, rev_id='A')
842
 
        wt.commit("base", allow_pointless=True, rev_id='B')
843
 
        wt.commit("base", allow_pointless=True, rev_id='C')
844
 
        try:
845
 
            # monkey patch gpg signing mechanism
846
 
            from bzrlib.testament import Testament
847
 
            bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
848
 
            self.runbzr('re-sign -r 1..')
849
 
            self.assertEqual(
850
 
                Testament.from_revision(branch.repository,'A').as_short_text(),
851
 
                branch.repository.revision_store.get('A', 'sig').read())
852
 
            self.assertEqual(
853
 
                Testament.from_revision(branch.repository,'B').as_short_text(),
854
 
                branch.repository.revision_store.get('B', 'sig').read())
855
 
            self.assertEqual(Testament.from_revision(branch.repository,
856
 
                             'C').as_short_text(),
857
 
                             branch.repository.revision_store.get('C', 
858
 
                             'sig').read())
859
 
        finally:
860
 
            bzrlib.gpg.GPGStrategy = oldstrategy
861
 
 
862
817
    def test_push(self):
863
818
        # create a source branch
864
819
        os.mkdir('my-branch')