mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
tests: add UserDataAudio unit tests
This commit is contained in:
parent
44f4ad94ba
commit
3f4d85574a
15
tests/movies/test_user_audio.py
Normal file
15
tests/movies/test_user_audio.py
Normal file
@ -0,0 +1,15 @@
|
||||
import pytest
|
||||
|
||||
from panda3d.core import UserDataAudio
|
||||
|
||||
|
||||
@pytest.mark.parametrize("remove_after_read", [True, False])
|
||||
def test_userdata_audio(remove_after_read):
|
||||
audio = UserDataAudio(48000, 2, remove_after_read)
|
||||
audio.append(b'abcdefgh')
|
||||
audio.done()
|
||||
cursor = audio.open()
|
||||
assert cursor.read_samples(0) == b''
|
||||
assert cursor.read_samples(1) == b'abcd'
|
||||
assert cursor.read_samples(1) == b'efgh'
|
||||
assert cursor.read_samples(1) == b''
|
Loading…
x
Reference in New Issue
Block a user