author | Alexandre Fayolle <alexandre.fayolle@logilab.fr> |
Thu, 15 Apr 2010 14:27:43 +0200 | |
branch | stable |
changeset 5279 | 42a37a50f2ff |
parent 4831 | c5aec27c1bf7 |
child 5421 | 8167de96c523 |
permissions | -rw-r--r-- |
0 | 1 |
"""unit tests for module cubicweb.server.sqlutils |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
2 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
0 | 3 |
""" |
4 |
||
5 |
import sys |
|
6 |
||
7 |
from logilab.common.testlib import TestCase, unittest_main |
|
8 |
||
9 |
from cubicweb.server.sqlutils import * |
|
10 |
||
11 |
BASE_CONFIG = { |
|
12 |
'db-driver' : 'Postgres', |
|
13 |
'db-host' : 'crater', |
|
14 |
'db-name' : 'cubicweb2_test', |
|
15 |
'db-user' : 'toto', |
|
16 |
'db-upassword' : 'toto', |
|
17 |
} |
|
18 |
||
19 |
class SQLAdapterMixInTC(TestCase): |
|
20 |
||
21 |
def test_init(self): |
|
22 |
o = SQLAdapterMixIn(BASE_CONFIG) |
|
4831
c5aec27c1bf7
[repo] use logilab.db instead of lgc.adbh/lgc.db/lgc.sqlgen/indexer, test new date extranction functions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
23 |
self.assertEquals(o.dbhelper.dbencoding, 'UTF-8') |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1016
diff
changeset
|
24 |
|
0 | 25 |
def test_init_encoding(self): |
26 |
config = BASE_CONFIG.copy() |
|
27 |
config['db-encoding'] = 'ISO-8859-1' |
|
28 |
o = SQLAdapterMixIn(config) |
|
4831
c5aec27c1bf7
[repo] use logilab.db instead of lgc.adbh/lgc.db/lgc.sqlgen/indexer, test new date extranction functions
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
29 |
self.assertEquals(o.dbhelper.dbencoding, 'ISO-8859-1') |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1016
diff
changeset
|
30 |
|
0 | 31 |
if __name__ == '__main__': |
32 |
unittest_main() |