def test_bad_option_length(self): with self.assertRaisesRegex(ValueError, 'must have length 4'): InfMaxRTOption.parse(bytes.fromhex('005300031a2b3c4d')) with self.assertRaisesRegex(ValueError, 'must have length 4'): InfMaxRTOption.parse(bytes.fromhex('005300051a2b3c4d00'))