aboutsummaryrefslogtreecommitdiff
path: root/test/test_config/test_sa.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_config/test_sa.py')
-rw-r--r--test/test_config/test_sa.py45
1 files changed, 18 insertions, 27 deletions
diff --git a/test/test_config/test_sa.py b/test/test_config/test_sa.py
index d6ff940..57459bc 100644
--- a/test/test_config/test_sa.py
+++ b/test/test_config/test_sa.py
@@ -25,6 +25,20 @@ from dodai.config.databases.sa import Sa
25 25
26class TestSa(unittest.TestCase): 26class TestSa(unittest.TestCase):
27 27
28 DB_ONE = {}
29 DB_ONE['protocol'] ='postgresql'
30 DB_ONE['protocol_extra'] ='psycopg2'
31 DB_ONE['hostname'] ='127.0.0.1'
32 DB_ONE['username'] ='test'
33 DB_ONE['password'] ='test'
34 DB_ONE['port'] ='12345'
35 DB_ONE['database'] ='testing'
36 DB_ONE['schema'] ='foo'
37
38 DB_TWO = {}
39 DB_TWO['protocol'] ='sqlite'
40 DB_TWO['filename'] ='/tmp/test'
41
28 def setUp(self): 42 def setUp(self):
29 self.create_engine = Dingus('create_engine') 43 self.create_engine = Dingus('create_engine')
30 self.session_maker = Dingus('session_maker') 44 self.session_maker = Dingus('session_maker')
@@ -32,33 +46,10 @@ class TestSa(unittest.TestCase):
32 self.obj = Sa(self.create_engine, self.session_maker, 46 self.obj = Sa(self.create_engine, self.session_maker,
33 self.result_object) 47 self.result_object)
34 48
35
36 def test_sa_one(self): 49 def test_sa_one(self):
37 name = 'test_db_two' 50 name = 'test_db_one'
38 obj = DbOne() 51 db = self.obj(self.DB_ONE, name)
39 db = self.obj(name, obj)
40
41 52
42 def test_sa_two(self): 53 def test_sa_two(self):
43 name = 'test_db_six' 54 name = 'test_db_two'
44 obj = DbTwo() 55 db = self.obj(self.DB_TWO, name)
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'