def test_pcap(self): with open(os.path.join("tests", "pcaps", self.pcapfile), "rb") as f: reader = PcapReader(f) reader.tcp = TCPPacketStreamer(reader, self.handlers) reader.tlsinfo = self.tlsinfo reader.raise_exceptions = self.use_exceptions output = [self.format(*stream) for stream in reader.process()] assert self.expected_output == output
def test_pcap(self): with open(os.path.join("tests", "pcaps", self.pcapfile), "rb") as f: reader = PcapReader(f) reader.tcp = TCPPacketStreamer(reader, self.handlers) reader.tlsinfo = self.tlsinfo reader.raise_exceptions = self.use_exceptions output = [ self.format(*stream) for stream in reader.process() ] assert len(self.expected_output) == len(output) and sorted(self.expected_output,key=lambda x: "" if x is None else str(x)) == sorted(output,key=lambda x: "" if x is None else str(x))