author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Wed, 02 Sep 2009 10:23:38 +0200 | |
branch | 3.5 |
changeset 3084 | 096d680c9da2 |
parent 2923 | b97a0f8dd4dc |
child 2968 | 0e3460341023 |
child 3252 | c0e10da6f1cf |
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 |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
4 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
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 |
0 | 13 |
repo, cnx = init_test_database('sqlite') |
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) |
|
21 |
self.planner = SSPlanner(self.o.schema, self.o._rqlhelper) |
|
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): |
|
2920
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
28 |
self._test('Any XN ORDERBY XN WHERE X name XN, X is IN (Basket, File, Folder)', |
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
29 |
[('OneFetchStep', [('Any XN ORDERBY XN WHERE X name XN, X is IN(Basket, File, Folder)', |
0 | 30 |
[{'X': 'Basket', 'XN': 'String'}, |
31 |
{'X': 'File', '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): |
2920
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
37 |
self._test('Any XN,COUNT(X) GROUPBY XN WHERE X name XN, X is IN (Basket, File, Folder)', |
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
38 |
[('OneFetchStep', [('Any XN,COUNT(X) GROUPBY XN WHERE X name XN, X is IN(Basket, File, Folder)', |
0 | 39 |
[{'X': 'Basket', 'XN': 'String'}, |
40 |
{'X': 'File', '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() |