示例#1
0
def test_get_from_system():
    nt.assert_equals(
        config.get('system_var_1'),
        'system_val_1',
    )
    nt.assert_equals(
        config.get('system_var_2'),
        'system_val_2',
    )
def test_get_from_system():
    nt.assert_equals(
        config.get('system_var_1'),
        'system_val_1',
    )
    nt.assert_equals(
        config.get('system_var_2'),
        'system_val_2',
    )
示例#3
0
def test_nonexistent_default():
    nt.assert_equals(
        config.get('i_dont_exist', 'foo'),
        'foo',
    )
示例#4
0
def test_nonexistent_throws():
    with nt.assert_raises(KeyError):
        config.get('i_dont_exist')
示例#5
0
def test_user_shadows_system():
    nt.assert_equals(
        config.get('system_var_3'),
        'user_val_3',
    )
示例#6
0
def test_get_from_user():
    nt.assert_equals(
        config.get('user_var_2'),
        'user_val_2',
    )
示例#7
0
def test_env_shadows_user():
    nt.assert_equals(
        config.get('user_var_1'),
        'env_val_2',
    )
示例#8
0
def test_get_from_env():
    nt.assert_equals(
        config.get('env_var_1'),
        'env_val_1',
    )
def test_nonexistent_default():
    nt.assert_equals(
        config.get('i_dont_exist', 'foo'),
        'foo',
    )
示例#10
0
def test_nonexistent_throws():
    with nt.assert_raises(KeyError):
        config.get('i_dont_exist')
示例#11
0
def test_user_shadows_system():
    nt.assert_equals(
        config.get('system_var_3'),
        'user_val_3',
    )
示例#12
0
def test_get_from_user():
    nt.assert_equals(
        config.get('user_var_2'),
        'user_val_2',
    )
示例#13
0
def test_env_shadows_user():
    nt.assert_equals(
        config.get('user_var_1'),
        'env_val_2',
    )
示例#14
0
def test_get_from_env():
    nt.assert_equals(
        config.get('env_var_1'),
        'env_val_1',
    )