author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Tue, 20 Apr 2010 16:31:53 +0200 | |
changeset 5355 | 3c703f3245dc |
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() |