improve back and frontend testing

This commit is contained in:
2026-03-29 19:58:06 -07:00
parent 29eee8a42c
commit e9215a64ff
70 changed files with 13441 additions and 134 deletions

View File

@@ -23,3 +23,17 @@ def test_color_map_node():
assert custom["stops"][0]["position"] == 0.0
assert custom["stops"][-1]["position"] == 1.0
assert len(custom["stops"]) == 3
# invalid JSON raises ValueError
try:
node.build(mode="custom", preset="viridis", stops_json="not valid json{")
assert False, "Expected ValueError"
except ValueError:
pass
# fewer than 2 stops raises ValueError
try:
node.build(mode="custom", preset="viridis", stops_json=json.dumps([{"position": 0.0, "color": "#000000"}]))
assert False, "Expected ValueError"
except ValueError:
pass