# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr## This file is part of CubicWeb.## CubicWeb is free software: you can redistribute it and/or modify it under the# terms of the GNU Lesser General Public License as published by the Free# Software Foundation, either version 2.1 of the License, or (at your option)# any later version.## CubicWeb is distributed in the hope that it will be useful, but WITHOUT# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more# details.## You should have received a copy of the GNU Lesser General Public License along# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.fromcubicweb.devtoolsimportinit_test_databasefromcubicweb.devtools.repotestimportBasePlannerTC,test_planfromcubicweb.server.ssplannerimportSSPlanner# keep cnx so it's not garbage collected and the associated session closeddefsetUpModule(*args):globalrepo,cnxrepo,cnx=init_test_database(apphome=SSPlannerTC.datadir)deftearDownModule(*args):globalrepo,cnxdelrepo,cnxclassSSPlannerTC(BasePlannerTC):_test=test_plandefsetUp(self):self.__class__.repo=repoBasePlannerTC.setUp(self)self.planner=SSPlanner(self.o.schema,self.repo.vreg.rqlhelper)self.system=self.o._repo.system_sourcedeftearDown(self):BasePlannerTC.tearDown(self)deftest_ordered_ambigous_sol(self):self._test('Any XN ORDERBY XN WHERE X name XN, X is IN (Basket, State, Folder)',[('OneFetchStep',[('Any XN ORDERBY XN WHERE X name XN, X is IN(Basket, State, Folder)',[{'X':'Basket','XN':'String'},{'X':'State','XN':'String'},{'X':'Folder','XN':'String'}])],None,None,[self.system],None,[])])deftest_groupeded_ambigous_sol(self):self._test('Any XN,COUNT(X) GROUPBY XN WHERE X name XN, X is IN (Basket, State, Folder)',[('OneFetchStep',[('Any XN,COUNT(X) GROUPBY XN WHERE X name XN, X is IN(Basket, State, Folder)',[{'X':'Basket','XN':'String'},{'X':'State','XN':'String'},{'X':'Folder','XN':'String'}])],None,None,[self.system],None,[])])if__name__=='__main__':fromlogilab.common.testlibimportunittest_mainunittest_main()