def test_init(self): KniminConfig(self.config_fp) with self.assertRaises(IOError): KniminConfig('does not exist') # test that expection is raised if not all sections are specified config = tempfile.NamedTemporaryFile() config.write(test_config[:122]) config.seek(0) config_fp = config.name with self.assertRaises(ValueError): KniminConfig(config_fp)
def test_get_postgres(self): config = KniminConfig(self.config_fp) self.assertEqual(config.db_user, 'test') self.assertEqual(config.db_password, '') self.assertEqual(config.db_database, 'knimin') self.assertEqual(config.db_host, 'localhost') self.assertEqual(config.db_port, 5432)
def test_get_tornado(self): config = KniminConfig(self.config_fp) self.assertEqual(config.http_port, 8888)
def test_get_main(self): config = KniminConfig(self.config_fp) self.assertTrue(config.debug)
def test_init(self): KniminConfig(self.config_fp) with self.assertRaises(IOError): KniminConfig('does not exist')
def test_get_main(self): config = KniminConfig(self.config_fp) self.assertTrue(config.debug) self.assertEqual(config.base_data_dir, '/some/dir/path')
#!/usr/bin/env python from knimin.lib.configuration import KniminConfig from knimin.lib.data_access import KniminAccess config = KniminConfig() db = KniminAccess(config) __all__ = ['config', 'db']
def test_get_jira(self): config = KniminConfig(self.config_fp) self.assertEqual(config.jira_host, 'http://127.0.0.1:2990/jira') self.assertEqual(config.jira_user, 'admin') self.assertEqual(config.jira_password, 'admin') self.assertEqual(config.jira_passkey, 'mykey')