コード例 #1
0
ファイル: test_alsamidi.py プロジェクト: ppaez/alsaseq
    def test_write_no_name(self):
        from alsamidi import Seq

        data = (9, 60, 127, 0, 10)
        event = (5, 1, 0, 0, (1, 0), (0, 0), (0, 0), data)
        track = [event]

        seq = Seq()
        seq.names = []
        seq.tags = {'name': 'value'}
        seq.orderedtags = ['name']
        seq.tracks = [track]

        seq.write('path')
        line = '5,1,0,0,1 0,0 0,0 0,9 60 127 0 10\n'
        self.file.write.assert_called_with(line)
コード例 #2
0
ファイル: test_alsamidi.py プロジェクト: ppaez/alsaseq
    def test_info(self):
        from alsamidi import Seq
        import alsamidi

        data = (9, 60, 127, 0, 10)
        event = (5, 1, 0, 0, (1, 0), (0, 0), (0, 0), data)
        track = [event]

        seq = Seq()
        seq.names = ['name']
        seq.tags = 'tags'
        seq.tracks = [track]
        seq.info()
        alsamidi.print.assert_any_call('tags')
        args = '0:', 'name           ', 0, 'Sec.', 1, 'events,', {9: [60]}, 'Hi Bongo'
        alsamidi.print.assert_called_with(*args)