dhcpkit.tests.ipv6.options.test_relay_message_option module

Test the RelayMessageOption implementation

class dhcpkit.tests.ipv6.options.test_relay_message_option.NonRelayableMessage(message_type: int = 0, message_data: bytes = b'')[source]

Bases: dhcpkit.ipv6.messages.UnknownMessage

A message that can not be relayed

class dhcpkit.tests.ipv6.options.test_relay_message_option.RelayMessageOptionTestCase(methodName='runTest')[source]

Bases: dhcpkit.tests.ipv6.options.test_option.OptionTestCase


Hook method for setting up the test fixture before exercising it.

class dhcpkit.tests.ipv6.options.test_relay_message_option.WeirdLengthMessage(transaction_id: bytes = b'x00x00x00', options: Iterable = None)[source]

Bases: dhcpkit.ipv6.messages.ClientServerMessage

An option that returns an incorrect length, to test error handling

load_from(buffer: bytes, offset: int = 0, length: int = None)[source]

Load the internal state of this object from the given buffer. The buffer may contain more data after the structured element is parsed. This data is ignored.

  • buffer – The buffer to read data from
  • offset – The offset in the buffer where to start reading
  • length – The amount of data we are allowed to read from the buffer

The number of bytes used from the buffer

message_type = 254