summaryrefslogtreecommitdiff
path: root/tests/test_commands.py
diff options
context:
space:
mode:
authordvora-h <67596500+dvora-h@users.noreply.github.com>2022-02-02 13:52:34 +0200
committerGitHub <noreply@github.com>2022-02-02 13:52:34 +0200
commitb541da6b00c00f038293b596a62b5ecb6fdbbaa4 (patch)
treed96061015d37c5ecddaf806cb54384120fb58e98 /tests/test_commands.py
parent7ea1bf7593f72b5e23f7e4efc7890faec8a3dde5 (diff)
downloadredis-py-b541da6b00c00f038293b596a62b5ecb6fdbbaa4.tar.gz
Add support for SINTERCARD (#1859)
* add sintercard * fix pr comment
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r--tests/test_commands.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_commands.py b/tests/test_commands.py
index f4d7fa7..a7135c0 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -1749,6 +1749,15 @@ class TestRedisCommands:
assert r.sinter("a", "b") == {b"2", b"3"}
@pytest.mark.onlynoncluster
+ # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
+ def test_sintercard(self, unstable_r):
+ unstable_r.sadd("a", 1, 2, 3)
+ unstable_r.sadd("b", 1, 2, 3)
+ unstable_r.sadd("c", 1, 3, 4)
+ assert unstable_r.sintercard(3, ["a", "b", "c"]) == 2
+ assert unstable_r.sintercard(3, ["a", "b", "c"], limit=1) == 1
+
+ @pytest.mark.onlynoncluster
def test_sinterstore(self, r):
r.sadd("a", "1", "2", "3")
assert r.sinterstore("c", "a", "b") == 0