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


import unittest
import struct
from calpack.common.ip import *
from calpack.utils import PYPY



class Test_UDP_HEADER(unittest.TestCase):
    def test_udp_header_native(self):
        """
        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):

# 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




class Test_UDP_HEADER(unittest.TestCase):
    def test_udp_header_native(self):
        """
        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: