~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_index.py

CombinedGraphIndex.validate() will now reload.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1214
1214
        self.assertListRaises(errors.NoSuchFile, index.iter_entries_prefix,
1215
1215
                                                 [('1',)])
1216
1216
 
 
1217
    def test_validate_reloads(self):
 
1218
        index, reload_counter = self.make_combined_index_with_missing()
 
1219
        index.validate()
 
1220
        self.assertEqual([1, 1, 0], reload_counter)
 
1221
 
 
1222
    def test_validate_reloads_midway(self):
 
1223
        index, reload_counter = self.make_combined_index_with_missing(['2'])
 
1224
        index.validate()
 
1225
 
 
1226
    def test_validate_no_reload(self):
 
1227
        index, reload_counter = self.make_combined_index_with_missing()
 
1228
        index._reload_func = None
 
1229
        self.assertRaises(errors.NoSuchFile, index.validate)
 
1230
 
 
1231
    def test_validate_reloads_and_fails(self):
 
1232
        index, reload_counter = self.make_combined_index_with_missing(
 
1233
                                    ['1', '2', '3'])
 
1234
        self.assertRaises(errors.NoSuchFile, index.validate)
 
1235
 
1217
1236
 
1218
1237
class TestInMemoryGraphIndex(TestCaseWithMemoryTransport):
1219
1238