author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> |
Tue, 02 Jun 2009 08:17:24 +0200 | |
changeset 2020 | fe437afc8fb7 |
parent 1977 | 606923dff11b |
child 4831 | c5aec27c1bf7 |
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) |
|
23 |
self.assertEquals(o.encoding, '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) |
|
29 |
self.assertEquals(o.encoding, '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() |