示例#1
0
def test_config_dict():
    conf = Config({'A': 1, 'B': 2}, C=3)
    assert len(conf) == 3

    # conf = Config.from_module(config_module)
    # assert "debug" in conf and "DEBUG" in conf and "DeBUg" in conf
    # conf['UPPER_KEY'] = 'UPPER_VALUE'
    # assert conf.get('upper_key') == 'UPPER_VALUE'

    conf = Config({'t_1': 1, 't_2': 2, 'x_3': 3, 'x_t': 4})
    assert conf.filter('T')._dict == {'2': 2, '1': 1}