summaryrefslogtreecommitdiff
path: root/tests/test_commands.py
diff options
context:
space:
mode:
authorAvital Fine <79420960+AvitalFineRedis@users.noreply.github.com>2021-09-01 11:44:28 +0300
committerGitHub <noreply@github.com>2021-09-01 11:44:28 +0300
commitde9922ad0fc955668d99748f3ad3be0ccff1f9da (patch)
tree80431770b019dd7511fc95d7ccb30e61ed604060 /tests/test_commands.py
parentefdba1a77a2755c70ba9754aa592dde8c8c50217 (diff)
downloadredis-py-de9922ad0fc955668d99748f3ad3be0ccff1f9da.tar.gz
Adding EXAT and PXAT (unix time support) support for SET (#1547)
* set in unix time * update skip version
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r--tests/test_commands.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py
index 0c9ca1e..2c0137f 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -1040,6 +1040,18 @@ class TestRedisCommands:
assert r.set('a', '1', ex=expire_at)
assert 0 < r.ttl('a') <= 60
+ @skip_if_server_version_lt('6.2.0')
+ def test_set_exat_timedelta(self, r):
+ expire_at = redis_server_time(r) + datetime.timedelta(seconds=10)
+ assert r.set('a', '1', exat=expire_at)
+ assert 0 < r.ttl('a') <= 10
+
+ @skip_if_server_version_lt('6.2.0')
+ def test_set_pxat_timedelta(self, r):
+ expire_at = redis_server_time(r) + datetime.timedelta(seconds=10)
+ assert r.set('a', '1', pxat=expire_at)
+ assert 0 < r.ttl('a') <= 10
+
@skip_if_server_version_lt('2.6.0')
def test_set_multipleoptions(self, r):
r['a'] = 'val'