3
0
فهرست منبع

additional named query tests

Roey Regev 6 سال پیش
والد
کامیت
492be56064
1فایلهای تغییر یافته به همراه20 افزوده شده و 1 حذف شده
  1. 20 1
      code/Test/test_NamedQueries.py

+ 20 - 1
code/Test/test_NamedQueries.py

@@ -14,4 +14,23 @@ class UnitTestPyparsing(unittest.TestCase):
         self.assertEqual(controller.statistics.process_db_query('least_used(portnumber)'),
                          [58645, 59844])
         self.assertEqual(controller.statistics.process_db_query('most_used(portnumber)'),
-                         443)
+                         443)
+        self.assertEqual(controller.statistics.process_db_query('most_used(protocolname)'),
+                         'IPv4')
+        self.assertEqual(controller.statistics.process_db_query('least_used(protocolname)'),
+                         'UDP')
+        self.assertEqual(controller.statistics.process_db_query('most_used(ttlvalue)'),
+                         64)
+        self.assertEqual(controller.statistics.process_db_query('least_used(ttlvalue)'),
+                         255)
+        self.assertEqual(controller.statistics.process_db_query('most_used(mssvalue)'),
+                         1460)
+        self.assertEqual(controller.statistics.process_db_query('least_used(mssvalue)'),
+                         1460)
+        self.assertEqual(controller.statistics.process_db_query('most_used(winsize)'),
+                         65535)
+        self.assertEqual(controller.statistics.process_db_query('most_used(ipclass)'),
+                         'A')
+        #FIXME why error?
+       # self.assertEqual(controller.statistics.process_db_query('least_used(ipclass)'),
+        #                 'E')