def test_bad_ipv6_prefix_length(self): S46V4V6BindingOption.parse(bytes.fromhex('005c001d010203048020010db8000000000000000000000000ffff0000fffe0000')) with self.assertRaisesRegex(ValueError, 'range from 0 to 128'): S46V4V6BindingOption.parse( bytes.fromhex('005c001f010203048120010db80000000000000000000000000000ffff0000fffe0000') )
def test_bad_option_length(self): with self.assertRaisesRegex(ValueError, 'shorter than the minimum length'): S46V4V6BindingOption.parse( bytes.fromhex('005c0001010203042020010db8ffff0000fffe0000')) with self.assertRaisesRegex(ValueError, 'length does not match'): S46V4V6BindingOption.parse( bytes.fromhex('005c0010010203042020010db8ffff0000fffe0000'))
def test_bad_ipv6_prefix_length(self): S46V4V6BindingOption.parse( bytes.fromhex( '005c001d010203048020010db8000000000000000000000000ffff0000fffe0000' )) with self.assertRaisesRegex(ValueError, 'range from 0 to 128'): S46V4V6BindingOption.parse( bytes.fromhex( '005c001f010203048120010db80000000000000000000000000000ffff0000fffe0000' ))
def test_bad_option_length(self): with self.assertRaisesRegex(ValueError, 'shorter than the minimum length'): S46V4V6BindingOption.parse(bytes.fromhex('005c0001010203042020010db8ffff0000fffe0000')) with self.assertRaisesRegex(ValueError, 'length does not match'): S46V4V6BindingOption.parse(bytes.fromhex('005c0010010203042020010db8ffff0000fffe0000'))