@@ -1480,6 +1480,29 @@ def test_brpoplpush_empty_string(self, r):
14801480 r .rpush ("a" , "" )
14811481 assert r .brpoplpush ("a" , "b" ) == b""
14821482
1483+ @pytest .mark .onlynoncluster
1484+ # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
1485+ def test_blmpop (self , unstable_r ):
1486+ unstable_r .rpush ("a" , "1" , "2" , "3" , "4" , "5" )
1487+ res = [b"a" , [b"1" , b"2" ]]
1488+ assert unstable_r .blmpop (1 , "2" , "b" , "a" , direction = "LEFT" , count = 2 ) == res
1489+ with pytest .raises (TypeError ):
1490+ unstable_r .blmpop (1 , "2" , "b" , "a" , count = 2 )
1491+ unstable_r .rpush ("b" , "6" , "7" , "8" , "9" )
1492+ assert unstable_r .blmpop (0 , "2" , "b" , "a" , direction = "LEFT" ) == [b"b" , [b"6" ]]
1493+ assert unstable_r .blmpop (1 , "2" , "foo" , "bar" , direction = "RIGHT" ) is None
1494+
1495+ @pytest .mark .onlynoncluster
1496+ # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
1497+ def test_lmpop (self , unstable_r ):
1498+ unstable_r .rpush ("foo" , "1" , "2" , "3" , "4" , "5" )
1499+ result = [b"foo" , [b"1" , b"2" ]]
1500+ assert unstable_r .lmpop ("2" , "bar" , "foo" , direction = "LEFT" , count = 2 ) == result
1501+ with pytest .raises (redis .ResponseError ):
1502+ unstable_r .lmpop ("2" , "bar" , "foo" , direction = "up" , count = 2 )
1503+ unstable_r .rpush ("bar" , "a" , "b" , "c" , "d" )
1504+ assert unstable_r .lmpop ("2" , "bar" , "foo" , direction = "LEFT" ) == [b"bar" , [b"a" ]]
1505+
14831506 def test_lindex (self , r ):
14841507 r .rpush ("a" , "1" , "2" , "3" )
14851508 assert r .lindex ("a" , "0" ) == b"1"
@@ -1748,6 +1771,15 @@ def test_sinter(self, r):
17481771 r .sadd ("b" , "2" , "3" )
17491772 assert r .sinter ("a" , "b" ) == {b"2" , b"3" }
17501773
1774+ @pytest .mark .onlynoncluster
1775+ # @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
1776+ def test_sintercard (self , unstable_r ):
1777+ unstable_r .sadd ("a" , 1 , 2 , 3 )
1778+ unstable_r .sadd ("b" , 1 , 2 , 3 )
1779+ unstable_r .sadd ("c" , 1 , 3 , 4 )
1780+ assert unstable_r .sintercard (3 , ["a" , "b" , "c" ]) == 2
1781+ assert unstable_r .sintercard (3 , ["a" , "b" , "c" ], limit = 1 ) == 1
1782+
17511783 @pytest .mark .onlynoncluster
17521784 def test_sinterstore (self , r ):
17531785 r .sadd ("a" , "1" , "2" , "3" )
0 commit comments