def test_get_cantus_firmus_range_too_high(self): """ Notes greater than 17 are ignored. """ raw = [18, 1] result = get_cantus_firmus(raw) expected = "g 1 \\bar \"|.\"" self.assertEqual(expected, result)
def test_good_get_cantus_firmus(self): """ The known good case. """ raw = [5, 7, 6, 5, 8, 7, 9, 8, 7, 6, 5] result = get_cantus_firmus(raw) expected = "d' 1 f' e' d' g' f' a' g' f' e' d' \\bar \"|.\"" self.assertEqual(expected, result)
def test_get_cantus_firmus_range_too_low(self): """ Notes less than 1 are ignored. """ raw = [0, 1] result = get_cantus_firmus(raw) expected = "g 1 \\bar \"|.\"" self.assertEqual(expected, result)
def test_empty_get_cantus_firmus(self): """ An empty list should produce an empty string. """ result = get_cantus_firmus([]) self.assertEqual('', result)