Ejemplo n.º 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)
Ejemplo n.º 2
0
    def test_get_length(self):
        mixstream = VorbisFileMixStream(self.filename)
        _length = mixstream.get_length()

        self.assertEqual(_length, self.length)
Ejemplo n.º 3
0
    def test_seek(self):
        time = 22
        mixstream = VorbisFileMixStream(self.filename)
        _seek = mixstream.seek(time)

        self.assertEqual(_seek, time)
Ejemplo n.º 4
0
    def test_get_position_init(self):
        mixstream = VorbisFileMixStream(self.filename)
        position = mixstream.get_position()

        self.assertEqual(position, -1)
Ejemplo n.º 5
0
    def test_stop(self):
        mixstream = VorbisFileMixStream(self.filename)
        mixstream.play(self.channel)
        mixstream.stop()

        self.assertFalse(mixstream.is_playing())
Ejemplo n.º 6
0
    def test_is_playing(self):
        mixstream = VorbisFileMixStream(self.filename)
        mixstream.play(self.channel)

        self.assertTrue(mixstream.is_playing())
Ejemplo n.º 7
0
    def test_play(self):
        mixstream = VorbisFileMixStream(self.filename)
        _play = mixstream.play(self.channel)

        self.assertEqual(_play, self.channel)
Ejemplo n.º 8
0
 def test_init_filetype_error(self):
     with self.assertRaises(VorbisFileError):
         VorbisFileMixStream(b"tests/notes_drumrolls.mid")
Ejemplo n.º 9
0
 def test_init_file_error(self):
     with self.assertRaises(IOError):
         VorbisFileMixStream(b"")