server/test/unittest_querier.py
changeset 9508 1263f1258796
parent 9467 ad66d7b3fd48
child 9543 39f981482e34
equal deleted inserted replaced
9507:540cb068a7f9 9508:1263f1258796
   125         self.assertEqual(len(rqlst.solutions), 1)
   125         self.assertEqual(len(rqlst.solutions), 1)
   126 
   126 
   127     def test_preprocess_security(self):
   127     def test_preprocess_security(self):
   128         plan = self._prepare_plan('Any ETN,COUNT(X) GROUPBY ETN '
   128         plan = self._prepare_plan('Any ETN,COUNT(X) GROUPBY ETN '
   129                                   'WHERE X is ET, ET name ETN')
   129                                   'WHERE X is ET, ET name ETN')
   130         plan.session = self.user_groups_session('users')
   130         plan.cnx = self.user_groups_session('users')
   131         union = plan.rqlst
   131         union = plan.rqlst
   132         plan.preprocess(union)
   132         plan.preprocess(union)
   133         self.assertEqual(len(union.children), 1)
   133         self.assertEqual(len(union.children), 1)
   134         self.assertEqual(len(union.children[0].with_), 1)
   134         self.assertEqual(len(union.children[0].with_), 1)
   135         subq = union.children[0].with_[0].query
   135         subq = union.children[0].with_[0].query
   208                           'ET is CWEType, X is Basket')
   208                           'ET is CWEType, X is Basket')
   209         self.assertEqual(solutions, [{'X': 'Basket', 'ET': 'CWEType', 'ETN': 'String'}])
   209         self.assertEqual(solutions, [{'X': 'Basket', 'ET': 'CWEType', 'ETN': 'String'}])
   210 
   210 
   211     def test_preprocess_security_aggregat(self):
   211     def test_preprocess_security_aggregat(self):
   212         plan = self._prepare_plan('Any MAX(X)')
   212         plan = self._prepare_plan('Any MAX(X)')
   213         plan.session = self.user_groups_session('users')
   213         plan.cnx = self.user_groups_session('users')
   214         union = plan.rqlst
   214         union = plan.rqlst
   215         plan.preprocess(union)
   215         plan.preprocess(union)
   216         self.assertEqual(len(union.children), 1)
   216         self.assertEqual(len(union.children), 1)
   217         self.assertEqual(len(union.children[0].with_), 1)
   217         self.assertEqual(len(union.children[0].with_), 1)
   218         subq = union.children[0].with_[0].query
   218         subq = union.children[0].with_[0].query