diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_dbz.py | 11 |
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")) |
