def test_ip_list(self): """Test ip_list function""" input_file_arg = os.path.join('tests', 'test.pcap') test = pcap2ip.Pcap2IP(input_file_arg) assert test.ip_list() == ['1.1.23.3', '1.1.12.1']
def test_coord2map(self): """Test coord2map function""" # Set command line arguments for testing purposes input_file_arg = os.path.join('tests', 'test.pcap') sys.argv = ['pcap2ip.py', input_file_arg] ip_list_test = pcap2ip.Pcap2IP(input_file_arg).ips test = ip2map.IP2Map(ip_list_test) PNG_PATH = os.path.join('tests', 'test.png') test.coord2map(PNG_PATH)
def test_ip2coord(self): """Test ip2coord function""" # Set command line arguments for testing purposes input_file_arg = os.path.join('tests', 'test.pcap') sys.argv = ['pcap2ip.py', input_file_arg] ip_list_test = pcap2ip.Pcap2IP(input_file_arg).ips test = ip2map.IP2Map(ip_list_test) assert test.ip2coord() == [[23.116671, 113.25], [23.116671, 113.25]]
def test_ip2map(self): """Test entire ip2map pipeline""" # Set command line arguments for testing purposes input_file_arg = os.path.join('tests', 'test.pcap') sys.argv = ['pcap2ip.py', input_file_arg] ip_list_test = pcap2ip.Pcap2IP(input_file_arg).ips test = ip2map.IP2Map(ip_list_test) assert test.coord_list == [[23.116671, 113.25], [23.116671, 113.25]] PNG_PATH = os.path.join('tests', 'test.png') test.coord2map(PNG_PATH)
def test_ingest_pcap(self): """Test ingest_pcap function""" input_file_arg = os.path.join('tests', 'test.pcap') test = pcap2ip.Pcap2IP(input_file_arg) test.ingest_pcap()
def test_pcap2ip(self): """Test entire pcap2ip pipeline""" input_file_arg = os.path.join('tests', 'test.pcap') test = pcap2ip.Pcap2IP(input_file_arg) assert test.ips == ['1.1.23.3', '1.1.12.1']