@@ -670,7 +670,7 @@ def test_client_unpause(self, r):
670
670
@pytest .mark .onlynoncluster
671
671
@skip_if_server_version_lt ("7.0.0" )
672
672
def test_client_no_evict (self , r ):
673
- assert r .client_no_evict ("ON" ) == "OK"
673
+ assert r .client_no_evict ("ON" )
674
674
with pytest .raises (TypeError ):
675
675
r .client_no_evict ()
676
676
@@ -1089,9 +1089,9 @@ def test_unlink_with_multiple_keys(self, r):
1089
1089
@skip_if_server_version_lt ("7.0.0" )
1090
1090
def test_lcs (self , r ):
1091
1091
r .mset ({"foo" : "ohmytext" , "bar" : "mynewtext" })
1092
- assert r .lcs ("foo" , "bar" ) == "mytext"
1092
+ assert r .lcs ("foo" , "bar" ) == b "mytext"
1093
1093
assert r .lcs ("foo" , "bar" , len = True ) == 6
1094
- result = ["matches" , [[[4 , 7 ], [5 , 8 ]]], "len" , 6 ]
1094
+ result = [b "matches" , [[[4 , 7 ], [5 , 8 ]]], b "len" , 6 ]
1095
1095
assert r .lcs ("foo" , "bar" , idx = True , minmatchlen = 3 ) == result
1096
1096
with pytest .raises (redis .ResponseError ):
1097
1097
assert r .lcs ("foo" , "bar" , len = True , idx = True )
@@ -1764,24 +1764,24 @@ def test_brpoplpush_empty_string(self, r):
1764
1764
@skip_if_server_version_lt ("7.0.0" )
1765
1765
def test_blmpop (self , r ):
1766
1766
r .rpush ("a" , "1" , "2" , "3" , "4" , "5" )
1767
- res = ["a" , ["1" , "2" ]]
1767
+ res = [b "a" , [b "1" , b "2" ]]
1768
1768
assert r .blmpop (1 , "2" , "b" , "a" , direction = "LEFT" , count = 2 ) == res
1769
1769
with pytest .raises (TypeError ):
1770
1770
r .blmpop (1 , "2" , "b" , "a" , count = 2 )
1771
1771
r .rpush ("b" , "6" , "7" , "8" , "9" )
1772
- assert r .blmpop (0 , "2" , "b" , "a" , direction = "LEFT" ) == ["b" , ["6" ]]
1772
+ assert r .blmpop (0 , "2" , "b" , "a" , direction = "LEFT" ) == [b "b" , [b "6" ]]
1773
1773
assert r .blmpop (1 , "2" , "foo" , "bar" , direction = "RIGHT" ) is None
1774
1774
1775
1775
@pytest .mark .onlynoncluster
1776
1776
@skip_if_server_version_lt ("7.0.0" )
1777
1777
def test_lmpop (self , r ):
1778
1778
r .rpush ("foo" , "1" , "2" , "3" , "4" , "5" )
1779
- result = ["foo" , ["1" , "2" ]]
1779
+ result = [b "foo" , [b "1" , b "2" ]]
1780
1780
assert r .lmpop ("2" , "bar" , "foo" , direction = "LEFT" , count = 2 ) == result
1781
1781
with pytest .raises (redis .ResponseError ):
1782
1782
r .lmpop ("2" , "bar" , "foo" , direction = "up" , count = 2 )
1783
1783
r .rpush ("bar" , "a" , "b" , "c" , "d" )
1784
- assert r .lmpop ("2" , "bar" , "foo" , direction = "LEFT" ) == ["bar" , ["a" ]]
1784
+ assert r .lmpop ("2" , "bar" , "foo" , direction = "LEFT" ) == [b "bar" , [b "a" ]]
1785
1785
1786
1786
def test_lindex (self , r ):
1787
1787
r .rpush ("a" , "1" , "2" , "3" )
@@ -2393,23 +2393,23 @@ def test_bzpopmin(self, r):
2393
2393
@skip_if_server_version_lt ("7.0.0" )
2394
2394
def test_zmpop (self , r ):
2395
2395
r .zadd ("a" , {"a1" : 1 , "a2" : 2 , "a3" : 3 })
2396
- res = ["a" , [["a1" , "1" ], ["a2" , "2" ]]]
2396
+ res = [b "a" , [[b "a1" , b "1" ], [b "a2" , b "2" ]]]
2397
2397
assert r .zmpop ("2" , ["b" , "a" ], min = True , count = 2 ) == res
2398
2398
with pytest .raises (redis .DataError ):
2399
2399
r .zmpop ("2" , ["b" , "a" ], count = 2 )
2400
2400
r .zadd ("b" , {"b1" : 10 , "ab" : 9 , "b3" : 8 })
2401
- assert r .zmpop ("2" , ["b" , "a" ], max = True ) == ["b" , [["b1" , "10" ]]]
2401
+ assert r .zmpop ("2" , ["b" , "a" ], max = True ) == [b "b" , [[b "b1" , b "10" ]]]
2402
2402
2403
2403
@pytest .mark .onlynoncluster
2404
2404
@skip_if_server_version_lt ("7.0.0" )
2405
2405
def test_bzmpop (self , r ):
2406
2406
r .zadd ("a" , {"a1" : 1 , "a2" : 2 , "a3" : 3 })
2407
- res = ["a" , [["a1" , "1" ], ["a2" , "2" ]]]
2407
+ res = [b "a" , [[b "a1" , b "1" ], [b "a2" , b "2" ]]]
2408
2408
assert r .bzmpop (1 , "2" , ["b" , "a" ], min = True , count = 2 ) == res
2409
2409
with pytest .raises (redis .DataError ):
2410
2410
r .bzmpop (1 , "2" , ["b" , "a" ], count = 2 )
2411
2411
r .zadd ("b" , {"b1" : 10 , "ab" : 9 , "b3" : 8 })
2412
- res = ["b" , [["b1" , "10" ]]]
2412
+ res = [b "b" , [[b "b1" , b "10" ]]]
2413
2413
assert r .bzmpop (0 , "2" , ["b" , "a" ], max = True ) == res
2414
2414
assert r .bzmpop (1 , "2" , ["foo" , "bar" ], max = True ) is None
2415
2415
@@ -3100,6 +3100,7 @@ def test_cluster_slaves(self, mock_cluster_resp_slaves):
3100
3100
3101
3101
@pytest .mark .onlynoncluster
3102
3102
@skip_if_server_version_lt ("3.0.0" )
3103
+ @skip_if_server_version_gte ("7.0.0" )
3103
3104
@skip_if_redis_enterprise ()
3104
3105
def test_readwrite (self , r ):
3105
3106
assert r .readwrite ()
@@ -4510,7 +4511,7 @@ def test_command_list(self, r: redis.Redis):
4510
4511
assert len (r .command_list ()) > 300
4511
4512
assert len (r .command_list (module = "fakemod" )) == 0
4512
4513
assert len (r .command_list (category = "list" )) > 15
4513
- assert "lpop" in r .command_list (pattern = "l*" )
4514
+ assert b "lpop" in r .command_list (pattern = "l*" )
4514
4515
with pytest .raises (redis .ResponseError ):
4515
4516
r .command_list (category = "list" , pattern = "l*" )
4516
4517
@@ -4546,7 +4547,10 @@ def test_command(self, r):
4546
4547
@skip_if_server_version_lt ("7.0.0" )
4547
4548
@skip_if_redis_enterprise ()
4548
4549
def test_command_getkeysandflags (self , r : redis .Redis ):
4549
- res = [["mylist1" , ["RW" , "access" , "delete" ]], ["mylist2" , ["RW" , "insert" ]]]
4550
+ res = [
4551
+ [b"mylist1" , [b"RW" , b"access" , b"delete" ]],
4552
+ [b"mylist2" , [b"RW" , b"insert" ]],
4553
+ ]
4550
4554
assert res == r .command_getkeysandflags (
4551
4555
"LMOVE" , "mylist1" , "mylist2" , "left" , "left"
4552
4556
)
0 commit comments