~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

MergeĀ JAMĀ Integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
241
241
        self.runbzr('revert')
242
242
        os.chdir('..')
243
243
 
244
 
    def test_status(self):
245
 
        self.runbzr("init")
246
 
        self.build_tree(['hello.txt'])
247
 
        result = self.runbzr("status")
248
 
        self.assert_("unknown:\n  hello.txt\n" in result, result)
249
 
        self.runbzr("add hello.txt")
250
 
        result = self.runbzr("status")
251
 
        self.assert_("added:\n  hello.txt\n" in result, result)
252
 
        self.runbzr("commit -m added")
253
 
        result = self.runbzr("status -r 0..1")
254
 
        self.assert_("added:\n  hello.txt\n" in result, result)
255
 
        self.build_tree(['world.txt'])
256
 
        result = self.runbzr("status -r 0")
257
 
        self.assert_("added:\n  hello.txt\n" \
258
 
                     "unknown:\n  world.txt\n" in result, result)
259
 
 
260
244
    def test_mv_modes(self):
261
245
        """Test two modes of operation for mv"""
262
246
        self.runbzr('init')
830
814
        self.runbzr('commit -m conflicts')
831
815
        self.assertEquals(result, "")
832
816
 
833
 
    def test_resign(self):
834
 
        """Test re signing of data."""
835
 
        import bzrlib.gpg
836
 
        oldstrategy = bzrlib.gpg.GPGStrategy
837
 
        wt = WorkingTree.create_standalone('.')
838
 
        branch = wt.branch
839
 
        wt.commit("base", allow_pointless=True, rev_id='A')
840
 
        try:
841
 
            # monkey patch gpg signing mechanism
842
 
            from bzrlib.testament import Testament
843
 
            bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
844
 
            self.runbzr('re-sign -r revid:A')
845
 
            self.assertEqual(Testament.from_revision(branch.repository,
846
 
                             'A').as_short_text(),
847
 
                             branch.repository.revision_store.get('A', 
848
 
                             'sig').read())
849
 
        finally:
850
 
            bzrlib.gpg.GPGStrategy = oldstrategy
851
 
            
852
 
    def test_resign_range(self):
853
 
        import bzrlib.gpg
854
 
        oldstrategy = bzrlib.gpg.GPGStrategy
855
 
        wt = WorkingTree.create_standalone('.')
856
 
        branch = wt.branch
857
 
        wt.commit("base", allow_pointless=True, rev_id='A')
858
 
        wt.commit("base", allow_pointless=True, rev_id='B')
859
 
        wt.commit("base", allow_pointless=True, rev_id='C')
860
 
        try:
861
 
            # monkey patch gpg signing mechanism
862
 
            from bzrlib.testament import Testament
863
 
            bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
864
 
            self.runbzr('re-sign -r 1..')
865
 
            self.assertEqual(
866
 
                Testament.from_revision(branch.repository,'A').as_short_text(),
867
 
                branch.repository.revision_store.get('A', 'sig').read())
868
 
            self.assertEqual(
869
 
                Testament.from_revision(branch.repository,'B').as_short_text(),
870
 
                branch.repository.revision_store.get('B', 'sig').read())
871
 
            self.assertEqual(Testament.from_revision(branch.repository,
872
 
                             'C').as_short_text(),
873
 
                             branch.repository.revision_store.get('C', 
874
 
                             'sig').read())
875
 
        finally:
876
 
            bzrlib.gpg.GPGStrategy = oldstrategy
877
 
 
878
817
    def test_push(self):
879
818
        # create a source branch
880
819
        os.mkdir('my-branch')