Пример #1
0
def test_invalidate_cache():
    cache, func = make_cached_func()
    val = func("foo")
    time.sleep(0.1)
    val2 = func("foo")
    assert val == val2

    cache.invalidate(func, "foo")
    val3 = func("foo")
    assert val3 != val
Пример #2
0
def test_invalidate_cache():
    cache, func = make_cached_func()
    val = func('foo')
    time.sleep(.1)
    val2 = func('foo')
    assert val == val2

    cache.invalidate(func, 'foo')
    val3 = func('foo')
    assert val3 != val
Пример #3
0
def test_invalidate_cache():
    cache, func = make_cached_func()
    val = func("foo")
    time.sleep(0.1)
    val2 = func("foo")
    assert val == val2

    cache.invalidate(func, "foo")
    val3 = func("foo")
    assert val3 != val