test_NamedQueries.py 675 B

1234567891011121314151617
  1. import unittest
  2. from definitions import ROOT_DIR
  3. import Core.Controller as Ctrl
  4. pcap = ROOT_DIR + "/../resources/test/reference_1998.pcap"
  5. controller = Ctrl.Controller(pcap_file_path=pcap, do_extra_tests=False, non_verbose=False)
  6. controller.load_pcap_statistics(flag_write_file=False, flag_recalculate_stats=True, flag_print_statistics=False)
  7. class UnitTestPyparsing(unittest.TestCase):
  8. def test_named_query(self):
  9. self.assertEqual(controller.statistics.process_db_query('least_used(portnumber)'),
  10. [58645, 59844])
  11. self.assertEqual(controller.statistics.process_db_query('most_used(portnumber)'),
  12. 443)