~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-02 16:57:09 UTC
  • mfrom: (5927.2.8 598572-zlib-error)
  • Revision ID: pqm@pqm.ubuntu.com-20110602165709-ry228rc95pgnj3g9
(jr) Display error when zlib corruption occurs rather than a backtrace
 (Jonathan Riddell)

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
        self.assertFalse(b._transport.has('branch-name'))
62
62
        b.bzrdir.open_workingtree().commit(message='foo', allow_pointless=True)
63
63
 
 
64
    def test_branch_broken_pack(self):
 
65
        """branching with a corrupted pack file."""
 
66
        self.example_branch('a')
 
67
        #now add some random corruption
 
68
        fname = 'a/.bzr/repository/packs/' + os.listdir('a/.bzr/repository/packs')[0]
 
69
        with open(fname, 'rb+') as f:
 
70
            f.seek(750)
 
71
            f.write("\xff")
 
72
        self.run_bzr_error(['Corruption while decompressing repository file'], 
 
73
                            'branch a b', retcode=3)
 
74
 
64
75
    def test_branch_switch_no_branch(self):
65
76
        # No branch in the current directory:
66
77
        #  => new branch will be created, but switch fails