def test_locate_frets_for_semitone_on_standard_guitar(self): instance = guitar.STANDARD_TUNING semitone = Semitone.from_string('G') expected_result = ((3, 15), (10, 22), (5, 17), (0, 12), (8, 20), (3, 15)) result = instance.locate_frets_for_semitone(semitone) self.assertEquals(result, expected_result)
def test_locate_frets_for_semitone_on_string_should_work_for_open_note( self): instance = guitar.STANDARD_TUNING semitone = Semitone.from_string('E') expected_result = (0, 12) result = instance.locate_frets_for_semitone_on_string(0, semitone) self.assertEquals(result, expected_result)
def test_locate_should_generate_open_d_major_chord(self): instance = ChordLocator(guitar.STANDARD_TUNING) semitone = Semitone.from_string('D') open_chord = (None, None, 0, 2, 3, 2) result = instance.locate(semitone, 'major') self.assertIn(open_chord, result)
def convert_to_semitones(scenario): root = Semitone.from_string(scenario[0]) scale_type = scenario[1] expected_scale = tuple(map(Semitone.from_string, scenario[2])) return (root, scale_type, expected_scale)
def test_from_string_with_sharps_and_flats_should_create_correct_semitone(self): expected_semitone = Semitone('D',flats=2,sharps=1) result = Semitone.from_string('D#bb') self.assertSame(result,expected_semitone)
def test_from_string_with_sharp_should_create_correct_semitone(self): expected_semitone = Semitone('D',sharps=2) result = Semitone.from_string('D##') self.assertSame(result,expected_semitone)
def test_from_string_with_natural_should_create_correct_semiton(self): expected_semitone = Semitone('D') result = Semitone.from_string('D') self.assertSame(result,expected_semitone)