Test JSON.SET with FPHAType enum values.
(client)
| 128 | @pytest.mark.redismod |
| 129 | @skip_if_server_version_lt(class="st">"8.7.0") |
| 130 | def 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 |