~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 14:05:34 UTC
  • mto: (2592.5.3 pack-repository)
  • mto: This revision was merged to the branch mainline in revision 2624.
  • Revision ID: robertc@robertcollins.net-20070712140534-fpo7n43occzqixe7
A validate that goes boom.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        trans.put_file('index', stream)
46
46
        return GraphIndex(trans, 'index')
47
47
 
 
48
    def test_open_bad_index_no_error(self):
 
49
        trans = self.get_transport()
 
50
        trans.put_bytes('name', "not an index\n")
 
51
        index = GraphIndex(trans, 'name')
 
52
 
48
53
    def test_iter_all_entries_empty(self):
49
54
        index = self.make_index()
50
55
        self.assertEqual([], list(index.iter_all_entries()))
52
57
    def test_iter_missing_entry_empty(self):
53
58
        index = self.make_index()
54
59
        self.assertRaises(errors.MissingKey, list, index.iter_entries(['a']))
 
60
 
 
61
    def test_validate_bad_index_errors(self):
 
62
        trans = self.get_transport()
 
63
        trans.put_bytes('name', "not an index\n")
 
64
        index = GraphIndex(trans, 'name')
 
65
        self.assertRaises(errors.BadIndexFormatSignature, index.validate)