Ejemplo n.º 1
0
    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']
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
    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]]
Ejemplo n.º 4
0
    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)
Ejemplo n.º 5
0
    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()
Ejemplo n.º 6
0
    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']