def test_database_config_superuser_dbinfo_no_file(self):
     open_ihm_config = OpenHEAConfig()
     open_ihm_config.read('not_there.cfg')
     expected = {
         'host': 'localhost',
         'database': 'openheadb',
         'user': '******',
         'password': '',
         'charset': 'utf8',
         'use_unicode': True,
         'get_warnings': True,
     }
     self.assertEqual(expected, open_ihm_config.superuser_dbinfo())
Esempio n. 2
0
 def __init__(self):
     config = OpenHEAConfig()
     self.config = config
     self.test_dir = os.path.dirname(__file__)
     config_file = os.path.join(self.test_dir, '..', 'test_openhea.cfg')
     read = config.read(config_file)
     if len(read) != 1:
         m = 'Need test_openhea.cfg setup with database parameters'
         e = unittest.SkipTest(m)
         raise e
     info = config.dbinfo()
     self.database = info['database']