def test_form2(self): self.assertEqual(Chord("C9"), Chord("C7(9)"))
def test_all_chord(self): for k, v in CHORD_MAP.items(): chord = note_to_chord(v)[0] self.assertEqual(chord, Chord("C" + k))
def test_omit1(self): chord = note_to_chord(["C", "E", "Bb", "D"])[0] self.assertEqual(chord, Chord("C7(9)"))
def test_form(self): self.assertEqual(Chord("Cm9"), Chord("Cm7(9)"))
def test_slash3(self): chord = note_to_chord(["C", "Gb", "Bb", "D"])[0] self.assertEqual(chord, Chord("Gbaug/C"))
def test_7th_integer(self): chord = note_to_chord([0, 4, 7, 10])[0] self.assertEqual(chord, Chord("C7"))
def test_slash1(self): chord = note_to_chord(["D", "C", "E", "G"])[0] self.assertEqual(chord, Chord("C/D"))
def test_slash2(self): chord = note_to_chord(["C", "A", "C", "E", "F#"])[0] self.assertEqual(chord, Chord("F#m7-5/C"))
def test_7th(self): chord = note_to_chord(["C", "E", "G", "Bb"])[0] self.assertEqual(chord, Chord("C7"))
def test_add9(self): chord = note_to_chord(["C", "E", "G", "D"])[0] self.assertEqual(chord, Chord("Cadd9"))
def test_major7thflat5(self): chord = note_to_chord(["C", "E", "Gb", "B"])[0] self.assertEqual(chord, Chord("CM7-5"))
def test_major11th(self): chord = note_to_chord(["C", "E", "G", "B", "D", "F"])[0] self.assertEqual(chord, Chord("CM7(9, 11)"))
def test_major7th(self): chord = note_to_chord(["C", "E", "G", "B"])[0] self.assertEqual(chord, Chord("CM7"))
def test_power(self): chord = note_to_chord(["E", "G", "C"])[0] self.assertEqual(chord, Chord("C/E"))
def test_notes(self): notes = list(range(12)) for k, scale in SCALE.items(): scale = sorted([Chord(note).bass for note in scale]) self.assertEqual(notes, scale, "Error: {}".format(k))