This commit is contained in:
khodowany
2026-10-04 04:29:10 -05:00
parent 04c6ea2e00
commit e8ac7b5edd
4 changed files with 7591 additions and 8534 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -100,7 +100,7 @@ class HarmonyTests(unittest.TestCase):
source = tests.test_musicxml.parse(tests.test_musicxml.xml_score(chord_xml('7', 'dominant', extra='<degree><degree-value>9</degree-value><degree-alter>-1</degree-alter><degree-type>add</degree-type></degree>') + tests.test_musicxml.xml_note()))
self.assertEqual(source['staves'][0]['measures'][0]['harmonies'][0]['symbol'], 'C7b9')
def test_current_song_exports_import_without_edits(self):
for name, count, key in (('autumn_leaves', 33, 'D minor'), ('it_could_happen_to_you', 32, 'Eb')):
for name, count, key in (('autumn_leaves', 33, 'D minor'), ('all-of-me', 32, 'G')):
source = generator.musicxml.load_musicxml(pathlib.Path('data/songs') / f'{name}.xml')
self.assertEqual(len(source['staves'][0]['measures']), count)
self.assertEqual(source['metadata']['key_signature'], key)
+3 -3
View File
@@ -84,7 +84,7 @@ class MusicModelTests(unittest.TestCase):
with self.assertRaisesRegex(ValueError, 'reduced'):
generator.model.validate_document(document)
def test_optional_turnaround_and_form(self):
source = generator.musicxml.load_musicxml(pathlib.Path('data/songs/it_could_happen_to_you.xml'))
source = generator.musicxml.load_musicxml(pathlib.Path('data/songs/all-of-me.xml'))
for part in ('acoustic', 'electric', 'vocal'):
result = generator.arrange.generate.arrange_document(source, part, rhythms=tests.rhythm_fixtures.library())
generator.model.validate_document(result)
@@ -94,8 +94,8 @@ class MusicModelTests(unittest.TestCase):
self.assertTrue(any(h for m in measures[:-1] for h in m['harmonies']))
self.assertFalse(any('chord_optional' in h for m in measures for h in m['harmonies']))
labels = [h['symbol'] for m in measures[:-1] for h in m['harmonies']]
self.assertIn('(Fm7)', labels)
self.assertIn('(Bb7)', labels)
self.assertIn('(Am7)', labels)
self.assertIn('(D7)', labels)
def test_legacy_repeat_model_fields_are_rejected(self):
for field in ('repeats', 'endings', 'initial_attributes'):
source = tests.test_musicxml.parse(tests.test_musicxml.xml_score(tests.test_musicxml.xml_note()))