~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 11:41:07 UTC
  • mfrom: (1442.1.60)
  • Revision ID: robertc@robertcollins.net-20051017114107-f5586285d825c105
Merge in first part of GPG support.

This adds check_signatures config support, triams back the transport api
to be leaner and easier to hook in suffixes - non primary streams in the store
associated with the fileid that primary data is stored in, a gpg module which
will encapsulate all signing and checking operations.

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()