Пример #1
0
def test_no_memoize():
    fn = Mock(__name__="fn")
    memoized = memoize(fn)
    memoized()
    memoized()
    assert fn.call_count == 2
Пример #2
0
def test_no_memoize():
    fn = Mock(__name__='fn')
    memoized = memoize(fn)
    memoized()
    memoized()
    assert fn.call_count == 2
Пример #3
0
def test_memoize():
    fn = Mock(__name__="fn")
    memoized = memoize(fn)
    memoized()
    memoized()
    fn.assert_called_once_with()
Пример #4
0
def test_memoize():
    fn = Mock(__name__='fn')
    memoized = memoize(fn)
    memoized()
    memoized()
    fn.assert_called_once_with()