705
706
"a option 0 1 :",
706
707
"b option 0 1 4 :" # We don't have a 4th record
708
self.assertRaises(errors.KnitCorrupt,
709
self.get_knit_index, transport, 'filename', 'r')
710
self.assertRaises(errors.KnitCorrupt,
711
self.get_knit_index, transport, 'filename', 'r')
713
if (str(e) == ('exceptions must be strings, classes, or instances,'
714
' not exceptions.IndexError')
715
and sys.version_info[0:2] >= (2,5)):
716
self.knownFailure('Pyrex <0.9.5 fails with TypeError when'
717
' raising new style exceptions with python'
711
720
def test_corrupted_parent(self):
712
721
transport = MockTransport([
715
724
"b option 0 1 :",
716
725
"c option 0 1 1v :", # Can't have a parent of '1v'
718
self.assertRaises(errors.KnitCorrupt,
719
self.get_knit_index, transport, 'filename', 'r')
728
self.assertRaises(errors.KnitCorrupt,
729
self.get_knit_index, transport, 'filename', 'r')
731
if (str(e) == ('exceptions must be strings, classes, or instances,'
732
' not exceptions.ValueError')
733
and sys.version_info[0:2] >= (2,5)):
734
self.knownFailure('Pyrex <0.9.5 fails with TypeError when'
735
' raising new style exceptions with python'
721
738
def test_corrupted_parent_in_list(self):
722
739
transport = MockTransport([
723
740
_KnitIndex.HEADER,
724
741
"a option 0 1 :",
725
742
"b option 0 1 :",
726
"c option 0 1 2 v :", # Can't have a parent of 'v'
743
"c option 0 1 1 v :", # Can't have a parent of 'v'
728
self.assertRaises(errors.KnitCorrupt,
729
self.get_knit_index, transport, 'filename', 'r')
746
self.assertRaises(errors.KnitCorrupt,
747
self.get_knit_index, transport, 'filename', 'r')
749
if (str(e) == ('exceptions must be strings, classes, or instances,'
750
' not exceptions.ValueError')
751
and sys.version_info[0:2] >= (2,5)):
752
self.knownFailure('Pyrex <0.9.5 fails with TypeError when'
753
' raising new style exceptions with python'
732
757
class LowLevelKnitIndexTests_c(LowLevelKnitIndexTests):