Skip to content

Commit

Permalink
Test that all "M" and "maj" qualities are synonyms for each other
Browse files Browse the repository at this point in the history
The existance of, for example Cmaj13, may suggest the existance of
CM13, which currently doesn't exist
  • Loading branch information
Jeremy Nickurak committed Dec 15, 2023
1 parent 1fce0cd commit 4efb3a7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/test_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ def test_invalid_eq(self):
with self.assertRaises(TypeError):
print(q == 0)

def subtest_quality_synonym(self, a, b):
with self.subTest(msg=f"{a}_has_{b}_synonym"):
a_quality = self.quality_manager.get_quality(a)
b_quality = self.quality_manager.get_quality(b)
self.assertEqual(a_quality, b_quality)

def test_maj_synonyms(self):
for q in self.quality_manager.get_qualities():
if q in ['M', 'maj']:
continue
if "maj" in q:
self.subtest_quality_synonym(q, q.replace("maj", "M"))
elif "M" in q:
self.subtest_quality_synonym(q, q.replace("M", "maj"))


class TestQualityManager(unittest.TestCase):

Expand Down

0 comments on commit 4efb3a7

Please sign in to comment.