diff options
author | Six <unknown> | 2010-04-20 21:00:04 -0400 |
---|---|---|
committer | Six <unknown> | 2010-04-20 21:00:04 -0400 |
commit | 5eb1f9bdf1ce4703dd867bcc46a50621d48f0cb4 (patch) | |
tree | f07acdb38c2e379831544bd4021f371e2e5970bf /test | |
parent | 61c0fede911b01508c5772d8f34ef02a3161bfde (diff) | |
download | dodai-macsupport-5eb1f9bdf1ce4703dd867bcc46a50621d48f0cb4.tar.bz2 dodai-macsupport-5eb1f9bdf1ce4703dd867bcc46a50621d48f0cb4.tar.xz dodai-macsupport-5eb1f9bdf1ce4703dd867bcc46a50621d48f0cb4.zip |
added new databases section
Diffstat (limited to 'test')
-rw-r--r-- | test/test_config/config.cfg | 1 | ||||
-rw-r--r-- | test/test_config/test_sa.py | 64 | ||||
-rw-r--r-- | test/test_tools/test_himo.py | 17 |
3 files changed, 82 insertions, 0 deletions
diff --git a/test/test_config/config.cfg b/test/test_config/config.cfg index 3480016..1254fbe 100644 --- a/test/test_config/config.cfg +++ b/test/test_config/config.cfg | |||
@@ -37,6 +37,7 @@ username=test | |||
37 | password=test | 37 | password=test |
38 | port=12345 | 38 | port=12345 |
39 | database=testing | 39 | database=testing |
40 | schema=foo | ||
40 | 41 | ||
41 | [test_db_three] | 42 | [test_db_three] |
42 | protocol=postgresss | 43 | protocol=postgresss |
diff --git a/test/test_config/test_sa.py b/test/test_config/test_sa.py new file mode 100644 index 0000000..d6ff940 --- /dev/null +++ b/test/test_config/test_sa.py | |||
@@ -0,0 +1,64 @@ | |||
1 | # Copyright (C) 2010 Leonard Thomas | ||
2 | # | ||
3 | # This file is part of Dodai. | ||
4 | # | ||
5 | # Dodai is free software: you can redistribute it and/or modify | ||
6 | # it under the terms of the GNU General Public License as published by | ||
7 | # the Free Software Foundation, either version 3 of the License, or | ||
8 | # (at your option) any later version. | ||
9 | # | ||
10 | # Dodai is distributed in the hope that it will be useful, | ||
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | # GNU General Public License for more details. | ||
14 | # | ||
15 | # You should have received a copy of the GNU General Public License | ||
16 | # along with Dodai. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
18 | import sys | ||
19 | import os | ||
20 | import unittest | ||
21 | from dingus import Dingus | ||
22 | path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..')) | ||
23 | sys.path.append(path) | ||
24 | from dodai.config.databases.sa import Sa | ||
25 | |||
26 | class TestSa(unittest.TestCase): | ||
27 | |||
28 | def setUp(self): | ||
29 | self.create_engine = Dingus('create_engine') | ||
30 | self.session_maker = Dingus('session_maker') | ||
31 | self.result_object = Dingus('result_object') | ||
32 | self.obj = Sa(self.create_engine, self.session_maker, | ||
33 | self.result_object) | ||
34 | |||
35 | |||
36 | def test_sa_one(self): | ||
37 | name = 'test_db_two' | ||
38 | obj = DbOne() | ||
39 | db = self.obj(name, obj) | ||
40 | |||
41 | |||
42 | def test_sa_two(self): | ||
43 | name = 'test_db_six' | ||
44 | obj = DbTwo() | ||
45 | db = self.obj(name, obj) | ||
46 | |||
47 | |||
48 | class DbOne(object): | ||
49 | |||
50 | def __init__(self): | ||
51 | self.protocol='postgresql' | ||
52 | self.protocol_extra='psycopg2' | ||
53 | self.hostname='127.0.0.1' | ||
54 | self.username='test' | ||
55 | self.password='test' | ||
56 | self.port='12345' | ||
57 | self.database='testing' | ||
58 | self.schema='foo' | ||
59 | |||
60 | class DbTwo(object): | ||
61 | |||
62 | def __init__(self): | ||
63 | self.protocol='sqlite' | ||
64 | self.filename='/tmp/test' | ||
diff --git a/test/test_tools/test_himo.py b/test/test_tools/test_himo.py index cb58ca5..dec2624 100644 --- a/test/test_tools/test_himo.py +++ b/test/test_tools/test_himo.py | |||
@@ -1,3 +1,20 @@ | |||
1 | # Copyright (C) 2010 Leonard Thomas | ||
2 | # | ||
3 | # This file is part of Dodai. | ||
4 | # | ||
5 | # Dodai is free software: you can redistribute it and/or modify | ||
6 | # it under the terms of the GNU General Public License as published by | ||
7 | # the Free Software Foundation, either version 3 of the License, or | ||
8 | # (at your option) any later version. | ||
9 | # | ||
10 | # Dodai is distributed in the hope that it will be useful, | ||
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | # GNU General Public License for more details. | ||
14 | # | ||
15 | # You should have received a copy of the GNU General Public License | ||
16 | # along with Dodai. If not, see <http://www.gnu.org/licenses/>. | ||
17 | |||
1 | import sys | 18 | import sys |
2 | import os | 19 | import os |
3 | import unittest | 20 | import unittest |