Esempio n. 1
0
def test_process_config(request_app=test_request_config):
    process_config = {test_key: 'bar', 'process_var': 'foo'}
    CONFIG.push_process_config(process_config)

    assert CONFIG[test_key] == 'bar'
    assert CONFIG['process_var'] == 'foo'

    request_app()

    assert CONFIG[test_key] == 'bar'
    assert CONFIG['process_var'] == 'foo'
    CONFIG.pop_process_config()
    
    assert_raises(AttributeError, lambda: 'process_var' not in CONFIG)
    assert_raises(IndexError, CONFIG.pop_process_config)
Esempio n. 2
0
def test_process_config(request_app=test_request_config):
    process_config = {test_key: 'bar', 'process_var': 'foo'}
    CONFIG.push_process_config(process_config)

    assert CONFIG[test_key] == 'bar'
    assert CONFIG['process_var'] == 'foo'

    request_app()

    assert CONFIG[test_key] == 'bar'
    assert CONFIG['process_var'] == 'foo'
    CONFIG.pop_process_config()

    assert_raises(AttributeError, lambda: 'process_var' not in CONFIG)
    assert_raises(IndexError, CONFIG.pop_process_config)
Esempio n. 3
0
def reset_config():
    while True:
        try:
            CONFIG._pop_object()
        except IndexError:
            break
Esempio n. 4
0
def reset_config():
    while True:
        try:
            CONFIG._pop_object()
        except IndexError:
            break