Browse Source

Additional tests for in operator

Roey Regev 6 years ago
parent
commit
d0e142463a
2 changed files with 4 additions and 4 deletions
  1. 4 0
      code/Test/test_NestedNamedQueries.py
  2. 0 4
      code/Test/test_SQLQueries.py

+ 4 - 0
code/Test/test_NestedNamedQueries.py

@@ -17,6 +17,10 @@ class UnitTestPyparsing(unittest.TestCase):
                          '52:54:00:12:35:02')
         self.assertEqual(controller.statistics.process_db_query('ipaddress(macaddress in least_used(macaddress))'),
                          '10.0.2.15')
+        self.assertEqual(controller.statistics.process_db_query('ipaddress(macaddress in 08:00:27:a3:83:43)'),
+                         '10.0.2.15')
+        self.assertEqual(controller.statistics.process_db_query('ipaddress(macaddress in [08:00:27:a3:83:43])'),
+                         '10.0.2.15')
         self.assertEqual(controller.statistics.process_db_query('ipaddress(macaddress in most_used(macaddress))'),
                          ['104.83.103.45',
                           '13.107.21.200',

+ 0 - 4
code/Test/test_SQLQueries.py

@@ -25,10 +25,6 @@ class UnitTestPyparsing(unittest.TestCase):
         query = "Select ipAddress from ip_statistics where ipaddress = 'abc'"
         self.assertEqual([], controller.statistics.stats_db.process_db_query(query))
 
-    def in_on_one_op(self):
-        query = "Select ipAddress from ip_statistics where pktsSent in [5]"
-        self.assertEqual("72.247.178.67", controller.statistics.stats_db.process_db_query(query))
-
     def test_severaloperator(self):
         query1 = "Select ipAddress from ip_Statistics where pktsSent = '5'"
         query2 = "Select ipAddress from ip_Statistics where pktsSent < '5'"