mirror of
https://github.com/lepture/captcha.git
synced 2025-08-15 12:11:56 +08:00
17 lines
338 B
Python
17 lines
338 B
Python
# coding: utf-8
|
|
|
|
from captcha.audio import AudioCaptcha
|
|
|
|
|
|
def test_audio_generate():
|
|
captcha = AudioCaptcha()
|
|
data = captcha.generate('1234')
|
|
assert isinstance(data, bytearray)
|
|
assert bytearray(b'RIFF') in data
|
|
|
|
|
|
def test_audio_random():
|
|
captcha = AudioCaptcha()
|
|
data = captcha.random(4)
|
|
assert len(data) == 4
|