From 1ef886da7e29aa619ab33e71c8136d87e40cdf37 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 28 Oct 2026 10:44:24 +0100 Subject: Name the .dbz figure entry after the scene instance Co-Authored-By: Claude Sonnet 5.5 --- tests/test_dbz.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/test_dbz.py') diff --git a/tests/test_dbz.py b/tests/test_dbz.py index 35c7699..2e5ffe8 100644 --- a/tests/test_dbz.py +++ b/tests/test_dbz.py @@ -83,3 +83,14 @@ class DbzTest(unittest.TestCase): with tempfile.TemporaryDirectory() as d: with self.assertRaisesRegex(Error, "cannot write"): write(self.doc, Path(d) / "missing" / "s.dbz") + + def test_instance_name_and_label_on_entry(self): + with tempfile.TemporaryDirectory() as d: + duf = Path(d) / "s.duf" + duf.write_text(json.dumps({"scene": {"nodes": [ + {"id": "Fig", "url": "/data/Test/Fig/Fig.dsf#Fig", + "name": "Alice", "label": "Alice Label"}]}})) + with contextlib.redirect_stderr(io.StringIO()): + doc = build(load(duf, Library([DATA / "lib"])), [DATA / "lib"]) + fig = doc["figures"][0] + self.assertEqual((fig["name"], fig["label"], fig["id"]), ("Alice", "Alice Label", "Fig")) -- cgit v1.2.3