コード例 #1
0
    def test_bad_option_length(self):
        with self.assertRaisesRegex(ValueError, 'must have length 4'):
            SolMaxRTOption.parse(bytes.fromhex('005200031a2b3c4d'))

        with self.assertRaisesRegex(ValueError, 'must have length 4'):
            SolMaxRTOption.parse(bytes.fromhex('005200051a2b3c4d00'))
コード例 #2
0
ファイル: __init__.py プロジェクト: jackjack821/dhcpkit
    def __init__(self, sol_max_rt: int, always_send: bool = False):
        option = SolMaxRTOption(sol_max_rt=sol_max_rt)
        option.validate()

        super().__init__(option, always_send=always_send)
コード例 #3
0
 def setUp(self):
     self.option_bytes = bytes.fromhex('005200041a2b3c4d')
     self.option_object = SolMaxRTOption(sol_max_rt=439041101)
     self.parse_option()
コード例 #4
0
ファイル: sol_max_rt.py プロジェクト: mndfcked/dhcpkit
    def __init__(self, sol_max_rt: int):
        option = SolMaxRTOption(sol_max_rt=sol_max_rt)
        option.validate()

        super().__init__(option)