Пример #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']
Пример #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)
Пример #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]]
Пример #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)
Пример #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()
Пример #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']