Example #1
0
    def test_get_note_octave(self):
        parser = RtttlParser(self.SONG['rtttl'])

        result = parser.get_note_octave('4c#.7')

        expected_result = '7'

        self.assertTrue(result == expected_result)
Example #2
0
    def test_get_notes(self):
        parser = RtttlParser(self.SONG['rtttl'])

        result = parser.get_notes()

        expected_result = self.SONG['notes']

        self.assertTrue(result == expected_result)
Example #3
0
    def test_get_note_elements(self):
        parser = RtttlParser(self.SONG['rtttl'])

        result = parser.get_note_elements('4c#.7')

        expected_result = ('4', 'c#', '.', '7')

        self.assertTrue(result == expected_result)
    def test_get_note_octave(self):
        parser = RtttlParser(self.SONG['rtttl'])

        result = parser.get_note_octave('4c#.7')

        expected_result = '7'

        self.assertTrue(result == expected_result)
Example #5
0
    def test_interpret(self):
        parser = RtttlParser(self.SONG['rtttl'])

        result = parser.interpret()

        expected_result = self.SONG['interpretation']

        self.assertTrue(result == expected_result)
    def test_get_note_elements(self):
        parser = RtttlParser(self.SONG['rtttl'])

        result = parser.get_note_elements('4c#.7')

        expected_result = ('4', 'c#', '.', '7')

        self.assertTrue(result == expected_result)
    def test_get_notes(self):
        parser = RtttlParser(self.SONG['rtttl'])

        result = parser.get_notes()

        expected_result = self.SONG['notes']

        self.assertTrue(result == expected_result)
    def test_interpret(self):
        parser = RtttlParser(self.SONG['rtttl'])

        result = parser.interpret()

        expected_result = self.SONG['interpretation']

        self.assertTrue(result == expected_result)
Example #9
0
 def test_frequencies(self):
     self.assertTrue(
         isinstance(RtttlParser(self.SONG['rtttl']).FREQUENCIES, dict))
Example #10
0
 def __init__(self, rtttl):
     self.rtttl = rtttl
     self.interpretation = RtttlParser(rtttl).interpret()
     self.durations = self.get_durations()
     self.frequencies = self.get_frequencies()