import sys import os import struct import ctypes ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) if ROOT not in sys.path: sys.path.insert(0, ROOT) from pymsc.lib1553.structures import Udp1553Header, Udp1553Message, CommandWord from pymsc.lib1553.constants import Marker from pymsc.lib1553.messages.a3_graphic_setting import MsgA3Payload from pymsc.lib1553.message_base import BaseMessage def test_base_message_pack_inverted_cw(): # Create BaseMessage for A3 # is_transmit=True -> include payload in packed bytes msg = BaseMessage('A3', MsgA3Payload, sub_addr=3, frequency=0, is_transmit=True) packed = msg.pack() # Find CTRL_BEGIN marker somewhere in the packed bytes (may be without Udp1553Header) ctrl_begin = struct.pack('