Skip to content

Commit be9adf4

Browse files
authored
Merge pull request #428 from Anipaleja/master
Add Unit Tests for Bitcrush Plugin
2 parents 7762b80 + b06c2e7 commit be9adf4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_bitcrush.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
1817
import numpy as np
1918
import pytest
2019

@@ -39,3 +38,10 @@ def test_bitcrush(bit_depth: float, fundamental_hz: float, sample_rate: float, n
3938

4039
expected_output = np.around(sine_wave.astype(np.float64) * (2**bit_depth)) / (2**bit_depth)
4140
np.testing.assert_allclose(output, expected_output, atol=0.01)
41+
42+
43+
def test_invalid_bit_depth_raises_exception():
44+
with pytest.raises(ValueError):
45+
Bitcrush(bit_depth=-5)
46+
with pytest.raises(ValueError):
47+
Bitcrush(bit_depth=100)

0 commit comments

Comments
 (0)