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

Function test_json_set_fpha_enum

tests/test_json.py:130–148  ·  tests/test_json.py::test_json_set_fpha_enum

Test JSON.SET with FPHAType enum values.

(client)

Source from the content-addressed store, hash-verified

128@pytest.mark.redismod
129@skip_if_server_version_lt(class="st">"8.7.0")
130def test_json_set_fpha_enum(client):
131 class="st">""class="st">"Test JSON.SET with FPHAType enum values."class="st">""
132 fp_array = [1.1, 2.2, 3.3, 4.4]
133 assert client.json().set(
134 class="st">"fpha_enum", Path.root_path(), fp_array, fpha=FPHAType.FP32
135 )
136 result = client.json().get(class="st">"fpha_enum", Path.root_path())
137 assert isinstance(result, list)
138 assert len(result) == 4
139
140 assert client.json().set(
141 class="st">"fpha_enum64", Path.root_path(), fp_array, fpha=FPHAType.FP64
142 )
143 assert client.json().set(
144 class="st">"fpha_enum16", Path.root_path(), fp_array, fpha=FPHAType.FP16
145 )
146 assert client.json().set(
147 class="st">"fpha_enumbf16", Path.root_path(), fp_array, fpha=FPHAType.BF16
148 )
149
150
151@pytest.mark.redismod

Callers

nothing calls this directly

Calls 4

root_pathMethod · 0.80
setMethod · 0.45
jsonMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected