def test_get_fourth_species_rising_final_cadence(self): """ Ensures that the final two notes are only a semitone apart if the melody is rising. """ # check for if the diatonic notes are a tone apart raw = [5, 12, 11, 10, 13, 12, 14, 13, 12, 11, 12] result = get_fourth_species(raw) expected = "r2 d'~ d' d''~ d'' c''~ c'' b'~ b' e''~ e'' d''~ d'' f''~ f'' e''~ e'' d''~ d'' cis'' d'' 1" self.assertEqual(expected, result) # and again if the diatonic notes are only a semitone apart raw = [5, 12, 11, 10, 13, 12, 14, 13, 12, 6, 7] result = get_fourth_species(raw) expected = "r2 d'~ d' d''~ d'' c''~ c'' b'~ b' e''~ e'' d''~ d'' f''~ f'' e''~ e'' d''~ d'' e' f' 1" self.assertEqual(expected, result)
def test_good_get_fourth_species(self): """ The good case for fourth species counterpoint. """ raw = [5, 12, 11, 10, 13, 12, 14, 13, 12, 11, 12] result = get_fourth_species(raw) expected = "r2 d'~ d' d''~ d'' c''~ c'' b'~ b' e''~ e'' d''~ d'' f''~ f'' e''~ e'' d''~ d'' cis'' d'' 1" self.assertEqual(expected, result)
def test_empty_get_fourth_species(self): """ An empty list should return an empty string. """ result = get_fourth_species([]) self.assertEqual('', result)