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

Function test_json_set_fpha_enum

tests/test_json.py:130–148  ·  view source on GitHub ↗

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("8.7.0")
130def test_json_set_fpha_enum(client):
131 """Test JSON.SET with FPHAType enum values."""
132 fp_array = [1.1, 2.2, 3.3, 4.4]
133 assert client.json().set(
134 "fpha_enum", Path.root_path(), fp_array, fpha=FPHAType.FP32
135 )
136 result = client.json().get("fpha_enum", Path.root_path())
137 assert isinstance(result, list)
138 assert len(result) == 4
139
140 assert client.json().set(
141 "fpha_enum64", Path.root_path(), fp_array, fpha=FPHAType.FP64
142 )
143 assert client.json().set(
144 "fpha_enum16", Path.root_path(), fp_array, fpha=FPHAType.FP16
145 )
146 assert client.json().set(
147 "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