# Path: calpack/utils.py
# PYPY = "PyPy" in sys.version


import unittest
import struct
from calpack.common.ip import *
from calpack.utils import PYPY
        """
        This test verifies the proper structuring of the UDP Header Packet for native endian
        formatting.
        """
        header = UDP_HEADER(
            source_port = 8080,
            dest_port = 8080,
            length = 2,
            checksum = 0xbeef
        )

        expected_val = struct.pack('HHHH', 8080, 8080, 2, 0xbeef)

        self.assertEqual(header.to_bytes(), expected_val)

    def test_udp_header_big(self):
        if PYPY:
            return True
            
        header = UDP_HEADER_BIG()
        header.source_port = 8080
        header.dest_port = 8080
        header.length = 2
        header.checksum = 0xbeef

        expected_val = struct.pack('>HHHH', 8080, 8080, 2, 0xbeef)

        self.assertEqual(header.to_bytes(), expected_val)

    def test_udp_header_little(self):

# Path: calpack/utils.py
# PYPY = "PyPy" in sys.version


# Path: tests/test_Common_IP.py
import unittest
import struct
from calpack.common.ip import *
from calpack.utils import PYPY

        """
        This test verifies the proper structuring of the UDP Header Packet for native endian
        formatting.
        """
        header = UDP_HEADER(
            source_port = 8080,
            dest_port = 8080,
            length = 2,
            checksum = 0xbeef
        )

        expected_val = struct.pack('HHHH', 8080, 8080, 2, 0xbeef)

        self.assertEqual(header.to_bytes(), expected_val)

    def test_udp_header_big(self):
        if PYPY:
            return True
            
        header = UDP_HEADER_BIG()
        header.source_port = 8080
        header.dest_port = 8080
        header.length = 2
        header.checksum = 0xbeef

        expected_val = struct.pack('>HHHH', 8080, 8080, 2, 0xbeef)

        self.assertEqual(header.to_bytes(), expected_val)

    def test_udp_header_little(self):

        if PYPY: 