Soloing
ci / checks (push) Successful in 50m39s

This commit is contained in:
khodowany
2026-10-01 06:31:14 -05:00
parent ce695a626a
commit eae432aa83
29 changed files with 1402 additions and 158 deletions
+9 -3
View File
@@ -42,6 +42,7 @@ class ScoreBundleTests(unittest.TestCase):
data, output = root / 'data', root / 'output'
(data / 'songs').mkdir(parents=True)
shutil.copytree(pathlib.Path('data/scales'), data / 'scales')
shutil.copytree(pathlib.Path('data/sequences/2_4'), data / 'sequences/2_4')
source = data / 'songs/fixture.xml'
source.write_text(tests.test_musicxml.xml_score(tests.test_musicxml.xml_note()))
args = argparse.Namespace(data_dir=data, output_dir=output, static_assets_dir=pathlib.Path('package/assets'), check=False)
@@ -49,12 +50,17 @@ class ScoreBundleTests(unittest.TestCase):
original = {p.relative_to(output): p.read_bytes() for p in output.rglob('*') if p.is_file()}
self.assertTrue(list(output.rglob('*.png')))
(data / 'rhythms' / 'drafts').mkdir(parents=True)
(data / 'sequences' / '3_4').mkdir(parents=True)
(data / 'sequences/3_4/0001.xml').write_text(tests.test_musicxml.xml_score(tests.test_musicxml.xml_note()))
for path in ('rhythms/0001.xml', 'rhythms/drafts/0002.xml', 'sequences/0001.xml', 'sequences/3_4/0002.xml'):
for path in ('rhythms/0001.xml', 'rhythms/drafts/0002.xml'):
(data / path).write_text('<unfinished')
generator.__main__.generate_assets(args)
self.assertEqual(original, {p.relative_to(output): p.read_bytes() for p in output.rglob('*') if p.is_file()})
sequence = data / 'sequences/2_4/0001.xml'
saved = sequence.read_bytes()
sequence.write_text('<unfinished')
with self.assertRaisesRegex(ValueError, '0001.xml'):
generator.__main__.generate_assets(args)
self.assertEqual(original, {p.relative_to(output): p.read_bytes() for p in output.rglob('*') if p.is_file()})
sequence.write_bytes(saved)
scale = data / 'scales/major_scale_modes/0002.xml'
previous = scale.read_bytes()
scale.write_text('<unfinished')