def _addDrum(self): drum = Drum("New drum", "XX", "o") drum.guessHeadData() drum.checkShortcuts() self._currentKit.append(drum) self._oldLines[drum] = -1 self.kitTable.addItem(drum.name) self.kitTable.setCurrentRow(len(self._currentKit) - 1) self._checkDrumButtons() self._checkAbbrs() self.drumName.setFocus() self.drumName.selectAll()
def testGuessHeadData_Unknown(self): drum = Drum("test", "td", "x") drum.guessHeadData() self.assertEqual(len(drum), 1) self.assertEqual(drum[0], "x") headData = drum.headData(None) self.assertEqual(headData.midiNote, DefaultKits.DEFAULT_NOTE) self.assertEqual(headData.midiVolume, DefaultKits.DEFAULT_VOLUME) self.assertEqual(headData.effect, "normal") self.assertEqual(headData.notationHead, "default") self.assertEqual(headData.notationLine, 0) self.assertEqual(headData.notationEffect, "none") self.assertEqual(headData.stemDirection, DefaultKits.STEM_UP) self.assertEqual(headData.shortcut, "x")
def testGuessHeadData_Known(self): drum = Drum("HiTom", "HT", "o") drum.guessHeadData() self.assertEqual(list(drum), ["o", "O", "g", "f", "d"]) headData = drum.headData(None) self.assertEqual(headData.midiNote, 50)