示例#1
0
def test_get_app_config(patch):
    patch.init(AppConfig)
    raw = {'raw': 1}
    ret = Apps.get_app_config(raw)
    assert isinstance(ret, AppConfig)
    AppConfig.__init__.assert_called_with(raw)
示例#2
0
def test_make_logger_for_app(patch, config):
    patch.many(Logger, ['start', 'adapt'])
    logger = Apps.make_logger_for_app(config, 'my_awesome_app', '17.1')
    logger.start.assert_called()
    logger.adapt.assert_called_with('my_awesome_app', '17.1')
示例#3
0
def test_get(magic):
    app = magic()
    Apps.apps['app_id'] = app
    assert Apps.get('app_id') == app