Example #1
0
def test_config_fixup_expand_user_var(*args, **kwargs):
    cfg = SafeConfigParser()
    cfg.add_section('test')
    cfg.set('test', 'test', '~')
    environ = {'HOME': 'success'}
    with mock.patch('os.environ', environ):
        config._config_fixup(cfg)
    eq_(cfg.get('test', 'test'), 'success')
Example #2
0
def test_config_fixup_ending_single_quotation_mark(*args, **kwargs):
    cfg = SafeConfigParser()
    cfg.add_section('test')
    cfg.set('test', 'test', 'test\'')
    config._config_fixup(cfg)
    eq_(cfg.get('test', 'test'), 'test')
Example #3
0
def test_config_fixup_wrapped_double_quotation_marks(*args, **kwargs):
    cfg = SafeConfigParser()
    cfg.add_section('test')
    cfg.set('test', 'test', '"test"')
    config._config_fixup(cfg)
    eq_(cfg.get('test', 'test'), 'test')