~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

[merge] from robert and fix up tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
509
509
        self.runbzr('commit -m conflicts')
510
510
        self.assertEquals(result, "")
511
511
 
 
512
    def test_resign(self):
 
513
        """Test re signing of data."""
 
514
        import bzrlib.gpg
 
515
        oldstrategy = bzrlib.gpg.GPGStrategy
 
516
        branch = Branch.initialize('.')
 
517
        branch.commit("base", allow_pointless=True, rev_id='A')
 
518
        try:
 
519
            # monkey patch gpg signing mechanism
 
520
            from bzrlib.testament import Testament
 
521
            bzrlib.gpg.GPGStrategy = bzrlib.gpg.LoopbackGPGStrategy
 
522
            self.runbzr('re-sign -r revid:A')
 
523
            self.assertEqual(Testament.from_revision(branch,'A').as_short_text(),
 
524
                             branch.revision_store.get('A', 'sig').read())
 
525
        finally:
 
526
            bzrlib.gpg.GPGStrategy = oldstrategy
 
527
 
512
528
def listdir_sorted(dir):
513
529
    L = os.listdir(dir)
514
530
    L.sort()
805
821
        branch = Branch.open('to')
806
822
        self.assertEqual(1, len(branch.revision_history()))
807
823
 
 
824
    def test_log(self):
 
825
        self.build_tree(['branch/', 'branch/file'])
 
826
        branch = Branch.initialize('branch')
 
827
        branch.add(['file'])
 
828
        branch.commit('add file', rev_id='A')
 
829
        url = self.get_remote_url('branch/file')
 
830
        output = self.capture('log %s' % url)
 
831
        self.assertEqual(7, len(output.split('\n')))
 
832
        
 
833
 
 
834
 
808
835