Esempio n. 1
0
 def test_add_source_spec(self):
     config = ODBCConfig()
     config.add_source("testdb", self.ACCESS_CONFIGSTR)
     config.add_source_spec("testdb", {'Database': "testdb.mdb"})
     self.assertEqual({'testdb': {
         'Database': "testdb.mdb"
     }}, config.source_specs)
Esempio n. 2
0
 def test_del_source_dependent(self):
     config = ODBCConfig()
     config.add_source("testdb", self.ACCESS_CONFIGSTR)
     config.add_source_spec("testdb", {'Database': "testdb.mdb"})
     config.del_source("testdb")
     self.assertEqual({}, config.sources)
     self.assertEqual({}, config.source_specs)
Esempio n. 3
0
 def test_add_source(self):
     config = ODBCConfig()
     config.add_source("testdb", self.ACCESS_CONFIGSTR)
     self.assertEqual({'testdb': self.ACCESS_CONFIGSTR}, config.sources)
     self.assertEqual({}, config.source_specs)
     self.assertEqual({}, config.odbc_info)
Esempio n. 4
0
 def test_add_source_reserved(self):
     config = ODBCConfig()
     with self.assertRaises(ODBCError):
         config.add_source("ODBC Data Sources", self.ACCESS_CONFIGSTR)
     with self.assertRaises(ODBCError):
         config.add_source("ODBC", self.ACCESS_CONFIGSTR)