@@ -22,9 +22,9 @@ class MusicModelTests(unittest.TestCase):
|
||||
engraving = patch('generator.__main__.engrave_tree')
|
||||
engraving.start()
|
||||
self.addCleanup(engraving.stop)
|
||||
catalogue = patch('generator.__main__.build_catalogue')
|
||||
catalogue.start()
|
||||
self.addCleanup(catalogue.stop)
|
||||
catalog = patch('generator.__main__.build_catalog')
|
||||
catalog.start()
|
||||
self.addCleanup(catalog.stop)
|
||||
def test_chord_semantics_are_not_voicing_heuristics(self):
|
||||
cases = {'C': {0, 4, 7}, 'Cdim': {0, 3, 6}, 'Cdim7': {0, 3, 6, 9}, 'Csus2': {0, 2, 7},
|
||||
'C7b5': {0, 4, 6, 10}, 'G7b9': {7, 11, 2, 5, 8}, 'Fmaj7#11': {5, 9, 0, 4, 11}}
|
||||
@@ -35,7 +35,7 @@ class MusicModelTests(unittest.TestCase):
|
||||
pitches = chord_pitches(definition, chord_positions(*chord_requirements(definition))[0])
|
||||
self.assertTrue(essentials.issubset({pitch_number(p) % 12 for p in pitches}), label)
|
||||
with self.assertRaises(ValueError):
|
||||
harmony.parse_symbol('Cunrecognised')
|
||||
harmony.parse_symbol('Cunrecognized')
|
||||
def test_transposition_preserves_spelling_octaves_modes(self):
|
||||
for p in ({'letter': 'b', 'alter': 1, 'octave': 4}, {'letter': 'c', 'alter': -1, 'octave': 4}, {'letter': 'f', 'alter': 2, 'octave': 4}):
|
||||
p['alter'] = rational(p['alter'])
|
||||
@@ -101,7 +101,7 @@ class MusicModelTests(unittest.TestCase):
|
||||
for text in ('Med.', 'Med. Swing', 'Medium', 'Medium Swing'):
|
||||
self.assertEqual(canonical_style(text), 'Medium Swing')
|
||||
with self.assertRaises(ValueError):
|
||||
canonical_style('Unrecognised style')
|
||||
canonical_style('Unrecognized style')
|
||||
def test_failure_preserves_generated_assets(self):
|
||||
with tempfile.TemporaryDirectory() as temp:
|
||||
root = Path(temp)
|
||||
|
||||
Reference in New Issue
Block a user