def test_byteswap(): assert byteswap('\xf0\x00\x00 \x0f\x01\x00 \x03\x00\x00\x00' ) == ' \x00\x00\xf0 \x00\x01\x0f\x00\x00\x00\x03'
def test_packet_swap(self): swapped_packet = IPBusPacket(byteswap(self.packet.raw)) assert self.packet == swapped_packet assert not self.packet != swapped_packet
def test_byteswap(): assert byteswap("\xf0\x00\x00 \x0f\x01\x00 \x03\x00\x00\x00") == " \x00\x00\xf0 \x00\x01\x0f\x00\x00\x00\x03"