upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/test_batch_glb.py
diff options
context:
space:
mode:
authorItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 15:15:09 -0500
committerItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com>2026-11-22 15:15:09 -0500
commitd728b80c3e2a5eecd873f77f27bd051dfa1f665c (patch)
treed1617a5fe6aaf9f4515f449b4029a7722f817e04 /tests/test_batch_glb.py
parent5b19549ee2cb4ea06bda92a4165015b10bcc15fa (diff)
parent23d231b8c678964283fcae64ec60db081fc91143 (diff)
Merge pull request #3146 from airp1ane
Diffstat (limited to 'tests/test_batch_glb.py')
-rw-r--r--tests/test_batch_glb.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_batch_glb.py b/tests/test_batch_glb.py
index 9056e4e4e..0a42f3c94 100644
--- a/tests/test_batch_glb.py
+++ b/tests/test_batch_glb.py
@@ -9,6 +9,7 @@ import json
9import os 9import os
10from pathlib import Path 10from pathlib import Path
11import struct 11import struct
12import subprocess
12import sys 13import sys
13import tempfile 14import tempfile
14import unittest 15import unittest
@@ -39,6 +40,27 @@ def _create_minimal_bc1_dds(color: int = 0xF800) -> bytes:
39 40
40 41
41class TestBatchGlb(unittest.TestCase): 42class TestBatchGlb(unittest.TestCase):
43 def test_cli_reports_directory_setup_errors(self) -> None:
44 with tempfile.TemporaryDirectory() as root:
45 missing = os.path.join(root, "missing")
46 blocked = os.path.join(root, "blocked")
47 with open(blocked, "wb"):
48 pass
49
50 for source, output, error in [
51 (missing, os.path.join(root, "out"), "Input directory does not exist"),
52 (root, blocked, "blocked"),
53 ]:
54 with self.subTest(source=source, output=output):
55 result = subprocess.run(
56 [sys.executable, "-I", os.path.join(TOOLS, "batch_glb.py"), source, output],
57 capture_output=True, text=True, check=False,
58 )
59 self.assertEqual(result.returncode, 1)
60 self.assertTrue(result.stderr.startswith("ERROR: "), result.stderr)
61 self.assertIn(error, result.stderr)
62 self.assertEqual(len(result.stderr.splitlines()), 1)
63
42 def test_batch_convert_synthetic(self) -> None: 64 def test_batch_convert_synthetic(self) -> None:
43 with tempfile.TemporaryDirectory() as in_dir, tempfile.TemporaryDirectory() as out_dir: 65 with tempfile.TemporaryDirectory() as in_dir, tempfile.TemporaryDirectory() as out_dir:
44 for i in range(3): 66 for i in range(3):