captcha/tests/test_audio.py
Ari Archer cb528e7a78
change 22050 hz 16 bit wavs to 8000 hz 8 bit ones
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
2023-10-30 19:30:23 +02:00

16 lines
338 B
Python

# coding: utf-8
from captcha.audio import AudioCaptcha
def test_audio_generate():
captcha = AudioCaptcha()
data = captcha.generate('a123')
assert isinstance(data, bytearray)
assert bytearray(b'RIFF') in data
def test_audio_random():
captcha = AudioCaptcha()
data = captcha.random(4)
assert len(data) == 4