예제 #1
0
    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)
예제 #2
0
 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)
예제 #3
0
 def test_get_tornado(self):
     config = KniminConfig(self.config_fp)
     self.assertEqual(config.http_port, 8888)
예제 #4
0
 def test_get_main(self):
     config = KniminConfig(self.config_fp)
     self.assertTrue(config.debug)
예제 #5
0
    def test_init(self):
        KniminConfig(self.config_fp)

        with self.assertRaises(IOError):
            KniminConfig('does not exist')
예제 #6
0
 def test_get_main(self):
     config = KniminConfig(self.config_fp)
     self.assertTrue(config.debug)
     self.assertEqual(config.base_data_dir, '/some/dir/path')
예제 #7
0
#!/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']
예제 #8
0
 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')