def test_bad_option_length(self): with self.assertRaisesRegex(ValueError, 'must have length 4'): CLTTimeOption.parse( bytes.fromhex('002e' # Option type: OPTION_CLT_TIME '0003' # Option length: 3 (must be 4) '00000384' # Client-Last-Transaction time: 900 )) with self.assertRaisesRegex(ValueError, 'must have length 4'): CLTTimeOption.parse( bytes.fromhex('002e' # Option type: OPTION_CLT_TIME '0005' # Option length: 5 (must be 4) '00000384' # Client-Last-Transaction time: 900 ))
def test_bad_option_length(self): with self.assertRaisesRegex(ValueError, 'must have length 4'): CLTTimeOption.parse(bytes.fromhex( '002e' # Option type: OPTION_CLT_TIME '0003' # Option length: 3 (must be 4) '00000384' # Client-Last-Transaction time: 900 )) with self.assertRaisesRegex(ValueError, 'must have length 4'): CLTTimeOption.parse(bytes.fromhex( '002e' # Option type: OPTION_CLT_TIME '0005' # Option length: 5 (must be 4) '00000384' # Client-Last-Transaction time: 900 ))