def read_pcap_file(cls, filename=None, random=False, pcap_id=KNOWN_PCAP_ID):
        """Read a PCAP file from test data."""
        filename = filename or f"pcap_{pcap_id}.pcap"
        path = os.path.join(
            os.path.abspath(os.path.dirname(__file__)), "files", filename
        )
        with open(path, "rb") as content_file:
            content = content_file.read()
            if random:
                content = content + str(uuid.uuid4()).encode()
            return BytesIO(content)
Read a PCAP file from test data.
tests/test_flowsynth.py