Пример #1
0
    def test_get_position_seek(self):
        time = 22
        mixstream = VorbisFileMixStream(self.filename)
        mixstream.seek(time)
        mixstream.play(self.channel)
        position = mixstream.get_position()

        self.assertEqual(position, time)
Пример #2
0
    def test_get_length(self):
        mixstream = VorbisFileMixStream(self.filename)
        _length = mixstream.get_length()

        self.assertEqual(_length, self.length)
Пример #3
0
    def test_seek(self):
        time = 22
        mixstream = VorbisFileMixStream(self.filename)
        _seek = mixstream.seek(time)

        self.assertEqual(_seek, time)
Пример #4
0
    def test_get_position_init(self):
        mixstream = VorbisFileMixStream(self.filename)
        position = mixstream.get_position()

        self.assertEqual(position, -1)
Пример #5
0
    def test_stop(self):
        mixstream = VorbisFileMixStream(self.filename)
        mixstream.play(self.channel)
        mixstream.stop()

        self.assertFalse(mixstream.is_playing())
Пример #6
0
    def test_is_playing(self):
        mixstream = VorbisFileMixStream(self.filename)
        mixstream.play(self.channel)

        self.assertTrue(mixstream.is_playing())
Пример #7
0
    def test_play(self):
        mixstream = VorbisFileMixStream(self.filename)
        _play = mixstream.play(self.channel)

        self.assertEqual(_play, self.channel)
Пример #8
0
 def test_init_filetype_error(self):
     with self.assertRaises(VorbisFileError):
         VorbisFileMixStream(b"tests/notes_drumrolls.mid")
Пример #9
0
 def test_init_file_error(self):
     with self.assertRaises(IOError):
         VorbisFileMixStream(b"")