Shared Catalog
ci / checks (push) Failing after 1h5m14s

This commit is contained in:
khodowany
2026-09-17 01:25:26 -05:00
parent 5941a4cd49
commit fa385205e2
23 changed files with 742 additions and 242 deletions
+17
View File
@@ -62,3 +62,20 @@ class CatalogueTests(unittest.TestCase):
with self.assertRaisesRegex(ValueError, 'output path collides'):
generate_practice_scores(source, output)
self.assertFalse(output.exists())
def test_runtime_id_collisions_preserve_existing_output(self):
with tempfile.TemporaryDirectory() as temporary:
source, output = Path(temporary) / 'source', Path(temporary) / 'output'
names = ('chord/one-two/three.xml', 'chord/one/two-three.xml')
for name in names:
path = source / name
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(xml_score(xml_note()), encoding='utf-8')
output.mkdir()
sentinel = output / 'existing.json'
sentinel.write_text('unchanged', encoding='utf-8')
with self.assertRaisesRegex(ValueError, 'practice exercise ID collision') as error:
generate_practice_scores(source, output)
for name in names:
self.assertIn(name, str(error.exception))
self.assertEqual(list(output.iterdir()), [sentinel])
self.assertEqual(sentinel.read_text(), 'unchanged')