author | Nicolas Chauvat <nicolas.chauvat@logilab.fr> |
Fri, 14 Aug 2009 14:39:38 +0200 | |
branch | stable |
changeset 2851 | d3b80a4faf3f |
parent 1977 | 606923dff11b |
child 2773 | b2530e3e0afb |
child 2920 | 64322aa83a1d |
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 |
||
12 |
# keep cnx so it's not garbage collected and the associated session is closed |
|
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): |
|
28 |
self._test('Any XN ORDERBY XN WHERE X name XN', |
|
29 |
[('OneFetchStep', [('Any XN ORDERBY XN WHERE X name XN', |
|
30 |
[{'X': 'Basket', 'XN': 'String'}, |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
47
diff
changeset
|
31 |
{'X': 'CWCache', 'XN': 'String'}, |
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
47
diff
changeset
|
32 |
{'X': 'CWConstraintType', 'XN': 'String'}, |
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
47
diff
changeset
|
33 |
{'X': 'CWEType', 'XN': 'String'}, |
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
47
diff
changeset
|
34 |
{'X': 'CWGroup', 'XN': 'String'}, |
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
47
diff
changeset
|
35 |
{'X': 'CWPermission', 'XN': 'String'}, |
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
47
diff
changeset
|
36 |
{'X': 'CWRType', 'XN': 'String'}, |
0 | 37 |
{'X': 'File', 'XN': 'String'}, |
38 |
{'X': 'Folder', 'XN': 'String'}, |
|
39 |
{'X': 'Image', 'XN': 'String'}, |
|
40 |
{'X': 'State', 'XN': 'String'}, |
|
41 |
{'X': 'Tag', u'XN': 'String'}, |
|
42 |
{'X': 'Transition', 'XN': 'String'}])], |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
43 |
None, None, |
0 | 44 |
[self.system], None, [])]) |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
45 |
|
0 | 46 |
def test_groupeded_ambigous_sol(self): |
47 |
self._test('Any XN,COUNT(X) GROUPBY XN WHERE X name XN', |
|
48 |
[('OneFetchStep', [('Any XN,COUNT(X) GROUPBY XN WHERE X name XN', |
|
49 |
[{'X': 'Basket', 'XN': 'String'}, |
|
1398
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
47
diff
changeset
|
50 |
{'X': 'CWCache', 'XN': 'String'}, |
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
47
diff
changeset
|
51 |
{'X': 'CWConstraintType', 'XN': 'String'}, |
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
47
diff
changeset
|
52 |
{'X': 'CWEType', 'XN': 'String'}, |
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
47
diff
changeset
|
53 |
{'X': 'CWGroup', 'XN': 'String'}, |
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
47
diff
changeset
|
54 |
{'X': 'CWPermission', 'XN': 'String'}, |
5fe84a5f7035
rename internal entity types to have CW prefix instead of E
sylvain.thenault@logilab.fr
parents:
47
diff
changeset
|
55 |
{'X': 'CWRType', 'XN': 'String'}, |
0 | 56 |
{'X': 'File', 'XN': 'String'}, |
57 |
{'X': 'Folder', 'XN': 'String'}, |
|
58 |
{'X': 'Image', 'XN': 'String'}, |
|
59 |
{'X': 'State', 'XN': 'String'}, |
|
60 |
{'X': 'Tag', u'XN': 'String'}, |
|
61 |
{'X': 'Transition', 'XN': 'String'}])], |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
62 |
None, None, |
0 | 63 |
[self.system], None, [])]) |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1398
diff
changeset
|
64 |
|
0 | 65 |
if __name__ == '__main__': |
66 |
from logilab.common.testlib import unittest_main |
|
67 |
unittest_main() |