예제 #1
0
파일: basic.py 프로젝트: mndfcked/dhcpkit
    def __init__(self, address: IPv6Address):
        # This option remains constant, so create a singleton that can be re-used
        option = ServerUnicastOption(server_address=address)
        option.validate()

        super().__init__(option, always_send=True)
예제 #2
0
    def test_bad_option_length(self):
        with self.assertRaisesRegex(ValueError, 'must have length 16'):
            ServerUnicastOption.parse(bytes.fromhex('000c000f'))

        with self.assertRaisesRegex(ValueError, 'must have length 16'):
            ServerUnicastOption.parse(bytes.fromhex('000c0011'))
예제 #3
0
    def __init__(self, address: IPv6Address):
        # This option remains constant, so create a singleton that can be re-used
        option = ServerUnicastOption(server_address=address)
        option.validate()

        super().__init__(option, always_send=True)
예제 #4
0
 def setUp(self):
     self.option_bytes = bytes.fromhex(
         '000c001020010db8000000000000000000000001')
     self.option_object = ServerUnicastOption(IPv6Address('2001:db8::1'))
     self.parse_option()
    def test_bad_option_length(self):
        with self.assertRaisesRegex(ValueError, 'must have length 16'):
            ServerUnicastOption.parse(bytes.fromhex('000c000f'))

        with self.assertRaisesRegex(ValueError, 'must have length 16'):
            ServerUnicastOption.parse(bytes.fromhex('000c0011'))