@@ -1003,6 +1003,7 @@ def test_debug_dollar(client):
10031003 assert client .json ().debug ("MEMORY" , "non_existing_doc" , "$..a" ) == []
10041004
10051005
1006+ @pytest .mark .redismod
10061007def test_resp_dollar (client ):
10071008
10081009 data = {
@@ -1149,6 +1150,7 @@ def test_resp_dollar(client):
11491150 assert client .json ().resp ("non_existing_doc" , "$..a" ) is None
11501151
11511152
1153+ @pytest .mark .redismod
11521154def test_arrindex_dollar (client ):
11531155
11541156 client .json ().set (
@@ -1397,3 +1399,18 @@ def test_decoders_and_unstring():
13971399 assert decode_list (b"45.55" ) == 45.55
13981400 assert decode_list ("45.55" ) == 45.55
13991401 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