aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSix <unknown>2010-04-20 21:00:04 -0400
committerSix <unknown>2010-04-20 21:00:04 -0400
commit5eb1f9bdf1ce4703dd867bcc46a50621d48f0cb4 (patch)
treef07acdb38c2e379831544bd4021f371e2e5970bf /test
parent61c0fede911b01508c5772d8f34ef02a3161bfde (diff)
downloaddodai-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.cfg1
-rw-r--r--test/test_config/test_sa.py64
-rw-r--r--test/test_tools/test_himo.py17
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
37password=test 37password=test
38port=12345 38port=12345
39database=testing 39database=testing
40schema=foo
40 41
41[test_db_three] 42[test_db_three]
42protocol=postgresss 43protocol=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
18import sys
19import os
20import unittest
21from dingus import Dingus
22path = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..'))
23sys.path.append(path)
24from dodai.config.databases.sa import Sa
25
26class 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
48class 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
60class 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
1import sys 18import sys
2import os 19import os
3import unittest 20import unittest