diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-28 10:37:19 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-28 10:37:19 +0100 |
| commit | 3a2884f1f056922758bf9fe790dfd05a3843055d (patch) | |
| tree | 0b5d120bcbe0c2913e35b7891361fb33f5dff629 /tests | |
| parent | 6d03ca3093f0bf9d91f6d9f978c0a715b8060bab (diff) | |
| download | generat3D-3a2884f1f056922758bf9fe790dfd05a3843055d.tar.gz generat3D-3a2884f1f056922758bf9fe790dfd05a3843055d.zip | |
Report .dbz write failures as Error
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_dbz.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_dbz.py b/tests/test_dbz.py index 7bcf69a..35c7699 100644 --- a/tests/test_dbz.py +++ b/tests/test_dbz.py @@ -24,6 +24,7 @@ import tempfile import unittest from pathlib import Path +from generat3d import Error from generat3d.dbz import build, orientation_quat, write from generat3d.library import Library from generat3d.scene import load @@ -77,3 +78,8 @@ class DbzTest(unittest.TestCase): with self.assertRaises(TypeError): write({"bad": object()}, out) self.assertEqual(list(Path(d).iterdir()), []) + + def test_os_error_becomes_error(self): + with tempfile.TemporaryDirectory() as d: + with self.assertRaisesRegex(Error, "cannot write"): + write(self.doc, Path(d) / "missing" / "s.dbz") |
