Skip to content

Commit 418f052

Browse files
Daniel-Chinshaypal5
authored andcommitted
simple test passed
1 parent e402614 commit 418f052

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import time
2+
from datetime import timedelta
3+
4+
import cachier
5+
6+
def test_call_with_freshness_threshold():
7+
@cachier.cachier()
8+
def test_func(a, b):
9+
print('Computing...')
10+
return a + b
11+
12+
print(f'{test_func(1, 2) = }')
13+
print(f'{test_func(1, 2) = }')
14+
caller_with_freshness_threshold = test_func.caller_with_freshness_threshold(
15+
timedelta(seconds=0.5),
16+
)
17+
print(f'{caller_with_freshness_threshold(1, 2) = }')
18+
print(f'{time.sleep(1.0) = }')
19+
print(f'{test_func(1, 2) = }')
20+
print(f'{caller_with_freshness_threshold(1, 2) = }')
21+
22+
if __name__ == '__main__':
23+
test_call_with_freshness_threshold()

0 commit comments

Comments
 (0)