Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ serde_json = "1.0"
serde = "1.0"
libc = "0.2"
jsonpath_lib = { git = "https://github.com/RedisJSON/jsonpath.git", branch = "generic_json_path" }
redis-module = { version="0.26", features = ["experimental-api"]}
#redis-module = { version="0.26", features = ["experimental-api"]}
redis-module = { git = "https://github.com/RedisLabsModules/redismodule-rs.git", branch="master", features = ["experimental-api"]}
itertools = "0.10.1"
[features]
# Workaround to allow cfg(feature = "test") in redismodue-rs dependencies:
Expand Down
14 changes: 14 additions & 0 deletions tests/pytest/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,20 @@ def testSetWithPathErrors(env):
r.expect('JSON.SET', 'x', '$[0]', 1).raiseError()
# r.assertEqual(str(e.exception), 'Err: path not an object')

def testGetWithPathErrors(env):
r = env

r.expect('JSON.SET', 'x', '.', '{}').ok()

# None-existing paths are reported with an error message
# If paths contain illegal characters, the error message must not contain them

# Path (and error message) with embedded nulls in path
r.expect('JSON.GET', 'x', 'gar\x00\x00bage').raiseError().contains("does not exist")

# Path (and error message) with end of line delimiters
r.expect('JSON.GET', 'x', 'not\x0d\x0aallowed by protocol').raiseError().contains("does not exist")

def testGetNonExistantPathsFromBasicDocumentShouldFail(env):
"""Test failure of getting non-existing values"""

Expand Down