summaryrefslogtreecommitdiff
path: root/tests/test_asyncio/test_json.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_asyncio/test_json.py')
-rw-r--r--tests/test_asyncio/test_json.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/test_asyncio/test_json.py b/tests/test_asyncio/test_json.py
index b8854d2..fc530c6 100644
--- a/tests/test_asyncio/test_json.py
+++ b/tests/test_asyncio/test_json.py
@@ -145,9 +145,15 @@ async def test_arrappend(modclient: redis.Redis):
@pytest.mark.redismod
async def test_arrindex(modclient: redis.Redis):
- await modclient.json().set("arr", Path.root_path(), [0, 1, 2, 3, 4])
- assert 1 == await modclient.json().arrindex("arr", Path.root_path(), 1)
- assert -1 == await modclient.json().arrindex("arr", Path.root_path(), 1, 2)
+ r_path = Path.root_path()
+ await modclient.json().set("arr", r_path, [0, 1, 2, 3, 4])
+ assert 1 == await modclient.json().arrindex("arr", r_path, 1)
+ assert -1 == await modclient.json().arrindex("arr", r_path, 1, 2)
+ assert 4 == await modclient.json().arrindex("arr", r_path, 4)
+ assert 4 == await modclient.json().arrindex("arr", r_path, 4, start=0)
+ assert 4 == await modclient.json().arrindex("arr", r_path, 4, start=0, stop=5000)
+ assert -1 == await modclient.json().arrindex("arr", r_path, 4, start=0, stop=-1)
+ assert -1 == await modclient.json().arrindex("arr", r_path, 4, start=1, stop=3)
@pytest.mark.redismod