def test_config_load(self):
Config.load()
config = InlineClass({
'debug': True,
'fallball_service_url': 'PUT_HERE_FALLBALL_SERVICE_URI',
'fallball_service_authorization_token': 'PUT_HERE_FALLBALL_SERVICE_AUTHORIZATION_TOKEN',
'oauth_key': 'PUT_HERE_OAUTH_KEY',
'oauth_secret': 'PUT_HERE_OAUTH_SECRET',
'diskspace_resource': 'DISKSPACE',
'devices_resource': 'DEVICES',
})
for (key, value) in viewitems(config.__dict__):
self.assertTrue(hasattr(Config, key))
Config.conf_file = 'tests/fake_config_invalid.json'
with self.assertRaises(RuntimeError):
Config.load()
Config.conf_file = 'not_exists'
with self.assertRaises(IOError):
Config.load()
评论列表
文章目录