コード例 #1
0
ファイル: test_relations.py プロジェクト: anderslime/smache
def test_computed_function_are_updated_when_relations_are():
    ax = DummyA('1', 10)
    ax2 = DummyA('2', 500)
    cx = DummyC('20', 500)
    cx2 = DummyC('30', 500)

    assert f(ax, cx, 5, 10) == 200
    assert f(ax2, cx2, 5, 10) == 10000

    DummyC.update('30', {'value': 30})

    assert smache.is_fun_fresh(f, ax, cx, 5, 10) == True
    assert smache.is_fun_fresh(f, ax2, cx2, 5, 10) == False