MCPcopy
hub / github.com/redis/redis-py / test_function_list

Method test_function_list

tests/test_function.py:54–81  ·  view source on GitHub ↗
(self, r)

Source from the content-addressed store, hash-verified

52
53 @pytest.mark.onlynoncluster
54 def test_function_list(self, r):
55 r.function_load(f"#!{engine} name={lib} \n {function}")
56 res = [
57 [
58 b"library_name",
59 b"mylib",
60 b"engine",
61 b"LUA",
62 b"functions",
63 [[b"name", b"myfunc", b"description", None, b"flags", [b"no-writes"]]],
64 ]
65 ]
66 resp3_res = [
67 {
68 b"library_name": b"mylib",
69 b"engine": b"LUA",
70 b"functions": [
71 {b"name": b"myfunc", b"description": None, b"flags": [b"no-writes"]}
72 ],
73 }
74 ]
75 assert_resp_response(r, r.function_list(), res, resp3_res)
76 assert_resp_response(r, r.function_list(library="*lib"), res, resp3_res)
77 res[0].extend(
78 [b"library_code", f"#!{engine} name={lib} \n {function}".encode()]
79 )
80 resp3_res[0][b"library_code"] = f"#!{engine} name={lib} \n {function}".encode()
81 assert_resp_response(r, r.function_list(withcode=True), res, resp3_res)
82
83 @pytest.mark.onlycluster
84 def test_function_list_on_cluster(self, r):

Callers

nothing calls this directly

Calls 5

assert_resp_responseFunction · 0.85
function_loadMethod · 0.80
function_listMethod · 0.80
encodeMethod · 0.80
extendMethod · 0.45

Tested by

no test coverage detected