author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Mon, 15 Feb 2010 17:47:50 +0100 | |
branch | stable |
changeset 4585 | 912aba7e6400 |
parent 4252 | 6c4f109c2b03 |
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:
1977
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 |
import os |
9 |
||
10 |
from logilab.common.testlib import TestCase, unittest_main |
|
11 |
||
2773
b2530e3e0afb
[testlib] #345052 and #344207: major test lib refactoring/cleanup + update usage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
12 |
from cubicweb.devtools import ApptestConfiguration, fake |
0 | 13 |
|
14 |
class WebconfigTC(TestCase): |
|
15 |
def setUp(self): |
|
16 |
self.config = ApptestConfiguration('data') |
|
16
a70ece4d9d1a
fix tests in web/test
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
17 |
self.config._cubes = ['file'] |
0 | 18 |
self.config.load_configuration() |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
16
diff
changeset
|
19 |
|
0 | 20 |
def test_nonregr_print_css_as_list(self): |
21 |
"""make sure PRINT_CSS *must* is a list""" |
|
22 |
config = self.config |
|
2773
b2530e3e0afb
[testlib] #345052 and #344207: major test lib refactoring/cleanup + update usage
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
23 |
req = fake.FakeRequest() |
0 | 24 |
print_css = req.external_resource('STYLESHEETS_PRINT') |
25 |
self.failUnless(isinstance(print_css, list)) |
|
26 |
ie_css = req.external_resource('IE_STYLESHEETS') |
|
27 |
self.failUnless(isinstance(ie_css, list)) |
|
28 |
||
29 |
def test_locate_resource(self): |
|
30 |
self.failUnless('FILE_ICON' in self.config.ext_resources) |
|
31 |
rname = self.config.ext_resources['FILE_ICON'].replace('DATADIR/', '') |
|
16
a70ece4d9d1a
fix tests in web/test
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
32 |
self.failUnless('file' in self.config.locate_resource(rname).split(os.sep)) |
0 | 33 |
cubicwebcsspath = self.config.locate_resource('cubicweb.css').split(os.sep) |
34 |
self.failUnless('web' in cubicwebcsspath or 'shared' in cubicwebcsspath) # 'shared' if tests under apycot |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
16
diff
changeset
|
35 |
|
0 | 36 |
if __name__ == '__main__': |
37 |
unittest_main() |
|
38 |
||
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
16
diff
changeset
|
39 |