@@ -1003,6 +1003,7 @@ def test_debug_dollar(client):
1003
1003
assert client .json ().debug ("MEMORY" , "non_existing_doc" , "$..a" ) == []
1004
1004
1005
1005
1006
+ @pytest .mark .redismod
1006
1007
def test_resp_dollar (client ):
1007
1008
1008
1009
data = {
@@ -1149,6 +1150,7 @@ def test_resp_dollar(client):
1149
1150
assert client .json ().resp ("non_existing_doc" , "$..a" ) is None
1150
1151
1151
1152
1153
+ @pytest .mark .redismod
1152
1154
def test_arrindex_dollar (client ):
1153
1155
1154
1156
client .json ().set (
@@ -1397,3 +1399,18 @@ def test_decoders_and_unstring():
1397
1399
assert decode_list (b"45.55" ) == 45.55
1398
1400
assert decode_list ("45.55" ) == 45.55
1399
1401
assert decode_list (['hello' , b'world' ]) == ['hello' , 'world' ]
1402
+
1403
+
1404
+ @pytest .mark .redismod
1405
+ def test_custom_decoder (client ):
1406
+ import ujson
1407
+ import json
1408
+
1409
+ cj = client .json (encoder = ujson , decoder = ujson )
1410
+ assert cj .set ("foo" , Path .rootPath (), "bar" )
1411
+ assert "bar" == cj .get ("foo" )
1412
+ assert cj .get ("baz" ) is None
1413
+ assert 1 == cj .delete ("foo" )
1414
+ assert client .exists ("foo" ) == 0
1415
+ assert not isinstance (cj .__encoder__ , json .JSONEncoder )
1416
+ assert not isinstance (cj .__decoder__ , json .JSONDecoder )
0 commit comments