def test_get_set_cache_half_life(flowmachine_connect_with_cache_settings_reset):
    """
    Test that cache halflife can be got and set
    """
    assert 1000 == get_cache_half_life(get_db())
    # Now set it to something
    set_cache_half_life(get_db(), 10)
    assert 10 == get_cache_half_life(get_db())
Example #2
0
def flowmachine_connect_with_cache_settings_reset(flowmachine_connect):
    """
    Fixture which ensures cache settings go back to what they were after
    they're manipulated.
    """
    max_cache_size = get_max_size_of_cache(flowmachine_connect)
    cache_half_life = get_cache_half_life(flowmachine_connect)
    yield flowmachine_connect
    set_max_size_of_cache(flowmachine_connect, max_cache_size)
    set_cache_half_life(flowmachine_connect, cache_half_life)
Example #3
0
def flowmachine_connect_with_cache_settings_reset(flowmachine_connect):
    """
    Fixture which ensures cache settings go back to what they were after
    they're manipulated.
    """
    max_cache_size = get_max_size_of_cache(get_db())
    cache_half_life = get_cache_half_life(get_db())
    cache_protect_period = get_cache_protected_period(get_db())
    yield
    set_max_size_of_cache(get_db(), max_cache_size)
    set_cache_half_life(get_db(), cache_half_life)
    set_cache_protected_period(get_db(), cache_protect_period)