diff options
author | Ben Connors <benconnors@outlook.com> | 2019-09-27 14:57:46 -0400 |
---|---|---|
committer | Ben Connors <benconnors@outlook.com> | 2019-09-27 14:57:46 -0400 |
commit | 0fc3371d48d7e87a5628b16c2bbd09c3fb15cd8e (patch) | |
tree | 64dd6994f04a08b269dcf14ff5c26b2d2b542db5 /tests/test_functions_audio.py | |
parent | dfe20c0430c7d58b57c44026102cf8b3c52ac1b3 (diff) |
Bugfixes
- Add some new tests
- Run some basic (interactive) chaser tests, they work-ish now
Diffstat (limited to 'tests/test_functions_audio.py')
-rw-r--r-- | tests/test_functions_audio.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/test_functions_audio.py b/tests/test_functions_audio.py index de6aa2a..35d548a 100644 --- a/tests/test_functions_audio.py +++ b/tests/test_functions_audio.py @@ -1,4 +1,6 @@ -import os +"""Tests for the audio primitive.""" + +import pytest from blc2.functions.audio import Audio @@ -15,6 +17,7 @@ def test_audio(aws): assert a.actual_duration == 0 a.filename = "tests/silence.m4a" + assert a.filename == "tests/silence.m4a" assert a.audio_scope == {"tests/silence.m4a"} assert a.duration == 2024 assert a.actual_duration == 3024 @@ -34,3 +37,25 @@ def test_audio(aws): _, ac, _ = a.render(5000) assert not ac + + with pytest.raises(ValueError): + _ = Audio(aws, id_=101, fade_in=-10) + + assert 101 not in aws.functions + + fout = a.fade_out + with pytest.raises(ValueError): + a.fade_out = -50 + assert a.fade_out == fout + + fin = a.fade_in + with pytest.raises(ValueError): + a.fade_in = -50 + assert a.fade_in == fin + + a._set_duration(10000) + assert a.copy_data(a.get_data()) is None + + a.filename = None + assert a.duration == 0 + assert a.actual_duration == 0 |