aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_dbz.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-28 10:44:24 +0100
committerDanilo M. <danix@danix.xyz>2026-10-28 10:44:24 +0100
commit1ef886da7e29aa619ab33e71c8136d87e40cdf37 (patch)
treed9e1103bd9e2743fbf12dd4f52360362b61ba77d /tests/test_dbz.py
parent0838881b87f3a59ccd841d247e4b975347529220 (diff)
downloadgenerat3D-1ef886da7e29aa619ab33e71c8136d87e40cdf37.tar.gz
generat3D-1ef886da7e29aa619ab33e71c8136d87e40cdf37.zip
Name the .dbz figure entry after the scene instance
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_dbz.py')
-rw-r--r--tests/test_dbz.py11
1 files changed, 11 insertions, 0 deletions
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"))