test_NestedNamedQueries.py 740 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_nested_query(self):
  9. self.assertEqual(controller.statistics.process_db_query('macaddress(ipaddress=most_used(ipaddress))'),
  10. '08:00:27:a3:83:43')
  11. self.assertEqual(controller.statistics.process_db_query('macaddress(ipaddress=least_used(ipaddress))'),
  12. '52:54:00:12:35:02')