예제 #1
0
 def test_sane_chord_tree_single_unique_note(self, mock_frets,
                                             mock_is_sane_configuration):
     mock_frets.return_value = [(0, ('E', 2))]
     mock_is_sane_configuration.return_value = True
     notes = [('E', 2)]
     expected = {(0, ('E', 2)) : {}}
     result = notemappings._sane_chord_tree(notes, capo=0)
     self.assertEqual(result, expected)
예제 #2
0
    def test_sane_chord_tree_a5_fifth(self, mock_frets,
                                      mock_is_sane_configuration):
        a5_positions = [(17, ('E', 2)), (12, ('A', 3))]
        e5_positions = [(19, ('A', 3)), (14, ('D', 3)), (9, ('G', 3))]
        mock_frets.side_effect = [a5_positions, e5_positions, e5_positions]

        # not the actual behaviour!
        mock_is_sane_configuration.side_effect = [True, True, True, True, False, False]

        notes = [('A', 4), ('E', 4)]
        # read: options for E if A is on the low e string, a string, etc.
        options = {(19, ('A', 3)) : {}, (14, ('D', 3)) : {}}
        expected = {(17, ('E', 2)) : options}
        self.assertEqual(notemappings._sane_chord_tree(notes, capo=0),
                         expected)