author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Wed, 10 Feb 2010 13:58:11 +0100 | |
changeset 4546 | f8ac61376b2b |
parent 4252 | 6c4f109c2b03 |
child 4766 | 162b2b127b15 |
permissions | -rw-r--r-- |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
1 |
""" |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
2 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
3 |
:organization: Logilab |
4212
ab6573088b4a
update copyright: welcome 2010
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
3587
diff
changeset
|
4 |
:copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
6 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
7 |
""" |
0 | 8 |
from cubicweb.devtools import init_test_database |
9 |
from cubicweb.devtools.repotest import BasePlannerTC, test_plan |
|
10 |
from cubicweb.server.ssplanner import SSPlanner |
|
11 |
||
2923
b97a0f8dd4dc
fix test schema and update some tests to work again with wf changes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2920
diff
changeset
|
12 |
# keep cnx so it's not garbage collected and the associated session closed |
2773
b2530e3e0afb
[testlib] #345052 and #344207: major test lib refactoring/cleanup + update usage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
13 |
repo, cnx = init_test_database() |
0 | 14 |
|
15 |
class SSPlannerTC(BasePlannerTC): |
|
16 |
repo = repo |
|
17 |
_test = test_plan |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
18 |
|
0 | 19 |
def setUp(self): |
20 |
BasePlannerTC.setUp(self) |
|
3252
c0e10da6f1cf
tests update
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2923
diff
changeset
|
21 |
self.planner = SSPlanner(self.o.schema, self.repo.vreg.rqlhelper) |
0 | 22 |
self.system = self.o._repo.system_source |
23 |
||
24 |
def tearDown(self): |
|
25 |
BasePlannerTC.tearDown(self) |
|
26 |
||
27 |
def test_ordered_ambigous_sol(self): |
|
3587 | 28 |
self._test('Any XN ORDERBY XN WHERE X name XN, X is IN (Basket, State, Folder)', |
29 |
[('OneFetchStep', [('Any XN ORDERBY XN WHERE X name XN, X is IN(Basket, State, Folder)', |
|
0 | 30 |
[{'X': 'Basket', 'XN': 'String'}, |
3587 | 31 |
{'X': 'State', 'XN': 'String'}, |
2920
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
32 |
{'X': 'Folder', 'XN': 'String'}])], |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
33 |
None, None, |
0 | 34 |
[self.system], None, [])]) |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
35 |
|
0 | 36 |
def test_groupeded_ambigous_sol(self): |
3587 | 37 |
self._test('Any XN,COUNT(X) GROUPBY XN WHERE X name XN, X is IN (Basket, State, Folder)', |
38 |
[('OneFetchStep', [('Any XN,COUNT(X) GROUPBY XN WHERE X name XN, X is IN(Basket, State, Folder)', |
|
0 | 39 |
[{'X': 'Basket', 'XN': 'String'}, |
3587 | 40 |
{'X': 'State', 'XN': 'String'}, |
2920
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
41 |
{'X': 'Folder', 'XN': 'String'}])], |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
42 |
None, None, |
0 | 43 |
[self.system], None, [])]) |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
44 |
|
0 | 45 |
if __name__ == '__main__': |
46 |
from logilab.common.testlib import unittest_main |
|
47 |
unittest_main() |