예제 #1
0
    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'))
예제 #2
0
    def __init__(self, inf_max_rt: int, always_send: bool = False):
        option = InfMaxRTOption(inf_max_rt=inf_max_rt)
        option.validate()

        super().__init__(option, always_send=always_send)
예제 #3
0
 def setUp(self):
     self.option_bytes = bytes.fromhex('005300041a2b3c4d')
     self.option_object = InfMaxRTOption(inf_max_rt=439041101)
     self.parse_option()
예제 #4
0
    def __init__(self, inf_max_rt: int):
        option = InfMaxRTOption(inf_max_rt=inf_max_rt)
        option.validate()

        super().__init__(option)