Skip to content

Commit 0881019

Browse files
committed
Merge branch 'lua-status-reply' into test_merge
2 parents ceda9cb + cb83787 commit 0881019

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mockredis/script.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def _call(*call_args):
5353
response = client.call(*call_args)
5454
return self._python_to_lua(response)
5555

56-
lua_globals.redis = {"call": _call}
56+
lua_globals.redis = {"call": _call,
57+
# TODO wrap _call with try to implement "pcall": _pcall,
58+
"status_reply": lambda status: self._python_to_lua({"ok": status}),
59+
"error_reply": lambda error: self._python_to_lua({"err": error})
60+
}
5761
return self._lua_to_python(lua.execute(self.script), return_status=True)
5862

5963
@staticmethod

0 commit comments

Comments
 (0)