File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1416,18 +1416,18 @@ def test_set_file(client):
1416
1416
@pytest .mark .redismod
1417
1417
def test_set_path (client ):
1418
1418
import json
1419
- import os
1420
1419
import tempfile
1421
1420
1422
1421
root = tempfile .mkdtemp ()
1423
1422
sub = tempfile .mkdtemp (dir = root )
1424
- ospointer , jsonfile = tempfile .mkstemp (suffix = ".json" , dir = sub )
1425
- ospointer2 , nojsonfile = tempfile .mkstemp (dir = root )
1423
+ jsonfile = tempfile .mktemp (suffix = ".json" , dir = sub )
1424
+ nojsonfile = tempfile .mktemp (dir = root )
1426
1425
1427
1426
with open (jsonfile , "w+" ) as fp :
1428
1427
fp .write (json .dumps ({"hello" : "world" }))
1429
1428
open (nojsonfile , "a+" ).write ("hello" )
1430
1429
1431
- result = {"/private" + jsonfile : True , "/private" + nojsonfile : False }
1432
- assert client .json ().set_path (Path .rootPath (), os .path .realpath (root )) == result
1433
- assert client .json ().get ("/private" + jsonfile .rsplit ("." )[0 ]) == {"hello" : "world" }
1430
+ result = {jsonfile : True , nojsonfile : False }
1431
+ print (result )
1432
+ assert client .json ().set_path (Path .rootPath (), root ) == result
1433
+ assert client .json ().get (jsonfile .rsplit ("." )[0 ]) == {"hello" : "world" }
You can’t perform that action at this time.
0 commit comments