Add option flags nx, xx, gt, lt for expire and pexpire#733
Add option flags nx, xx, gt, lt for expire and pexpire#733sauravsharma1998 wants to merge 4 commits intojazzband:masterfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #733 +/- ##
========================================
- Coverage 63.3% 62.6% -0.6%
========================================
Files 43 43
Lines 3215 3263 +48
Branches 244 244
========================================
+ Hits 2034 2042 +8
- Misses 1164 1204 +40
Partials 17 17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
@WisdomPill Can you please help. This PR failure is related to some dependency installation or test case? |
|
No dependency issue, have a look at |
|
@WisdomPill Could you please review the PR as per your convenience. |
|
In Progress #730 |
|
@WisdomPill Could you please review this PR? |
WisdomPill
left a comment
There was a problem hiding this comment.
types, tests and linters need to be fixed
| return super().persist(key=key, version=version, client=client) | ||
|
|
||
| def expire(self, key, timeout, version=None, client=None): | ||
| def expire( |
| cache.set("key1", "value1", timeout=None) | ||
| assert cache.expire("key1", 20, nx=True) is True | ||
| cache.set("key2", "value2", timeout=20) | ||
| assert cache.expire("key2", 21, xx=True) is True | ||
| assert cache.expire("key2", 30, gt=True) is True | ||
| assert cache.expire("key2", 20, lt=True) is True |
There was a problem hiding this comment.
you need to check also ttl after, please add separate tests or use parametrize
| cache.set("key1", "value1", timeout=None) | ||
| assert cache.pexpire("key1", 20000, nx=True) is True | ||
| cache.set("key2", "value2", timeout=20000) | ||
| assert cache.expire("key2", 20500, xx=True) is True | ||
| assert cache.expire("key2", 30000, gt=True) is True | ||
| assert cache.expire("key2", 20000, lt=True) is True |
No description provided.