author | Alexandre Fayolle <alexandre.fayolle@logilab.fr> |
Mon, 05 Apr 2010 09:06:16 +0200 | |
branch | stable |
changeset 5145 | bfa4d775219f |
parent 4766 | 162b2b127b15 |
child 5421 | 8167de96c523 |
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 |
|
4766
162b2b127b15
[test] get a chance to get proper garbage collection when running pytest on whole cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
15 |
def teardown_module(*args): |
162b2b127b15
[test] get a chance to get proper garbage collection when running pytest on whole cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
16 |
global repo, cnx |
162b2b127b15
[test] get a chance to get proper garbage collection when running pytest on whole cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
17 |
del repo, cnx |
162b2b127b15
[test] get a chance to get proper garbage collection when running pytest on whole cw
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4252
diff
changeset
|
18 |
|
0 | 19 |
class SSPlannerTC(BasePlannerTC): |
20 |
repo = repo |
|
21 |
_test = test_plan |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
22 |
|
0 | 23 |
def setUp(self): |
24 |
BasePlannerTC.setUp(self) |
|
3252
c0e10da6f1cf
tests update
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
2923
diff
changeset
|
25 |
self.planner = SSPlanner(self.o.schema, self.repo.vreg.rqlhelper) |
0 | 26 |
self.system = self.o._repo.system_source |
27 |
||
28 |
def tearDown(self): |
|
29 |
BasePlannerTC.tearDown(self) |
|
30 |
||
31 |
def test_ordered_ambigous_sol(self): |
|
3587 | 32 |
self._test('Any XN ORDERBY XN WHERE X name XN, X is IN (Basket, State, Folder)', |
33 |
[('OneFetchStep', [('Any XN ORDERBY XN WHERE X name XN, X is IN(Basket, State, Folder)', |
|
0 | 34 |
[{'X': 'Basket', 'XN': 'String'}, |
3587 | 35 |
{'X': 'State', 'XN': 'String'}, |
2920
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
36 |
{'X': 'Folder', 'XN': 'String'}])], |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
37 |
None, None, |
0 | 38 |
[self.system], None, [])]) |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
39 |
|
0 | 40 |
def test_groupeded_ambigous_sol(self): |
3587 | 41 |
self._test('Any XN,COUNT(X) GROUPBY XN WHERE X name XN, X is IN (Basket, State, Folder)', |
42 |
[('OneFetchStep', [('Any XN,COUNT(X) GROUPBY XN WHERE X name XN, X is IN(Basket, State, Folder)', |
|
0 | 43 |
[{'X': 'Basket', 'XN': 'String'}, |
3587 | 44 |
{'X': 'State', 'XN': 'String'}, |
2920
64322aa83a1d
start a new workflow engine
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
45 |
{'X': 'Folder', 'XN': 'String'}])], |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
46 |
None, None, |
0 | 47 |
[self.system], None, [])]) |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
48 |
|
0 | 49 |
if __name__ == '__main__': |
50 |
from logilab.common.testlib import unittest_main |
|
51 |
unittest_main() |