~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_index.py

  • Committer: Robert Collins
  • Date: 2007-07-12 15:51:19 UTC
  • mto: (2592.5.3 pack-repository)
  • mto: This revision was merged to the branch mainline in revision 2624.
  • Revision ID: robertc@robertcollins.net-20070712155119-zmcbukds65jw3tou
Detect truncated indices.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
        trans.put_bytes('index', new_content)
84
84
        self.assertRaises(errors.BadIndexOptions, index.validate)
85
85
 
 
86
    def test_validate_missing_end_line(self):
 
87
        index = self.make_index(2)
 
88
        trans = self.get_transport()
 
89
        content = trans.get_bytes('index')
 
90
        # truncate the last byte
 
91
        trans.put_bytes('index', content[:-1])
 
92
        self.assertRaises(errors.BadIndexData, index.validate)
 
93
 
86
94
    def test_validate_empty(self):
87
95
        index = self.make_index()
88
96
        index.validate()