mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-30 20:06:22 -05:00
Squashing config rework.
This commit is contained in:
parent
5425142adb
commit
08065155cf
38 changed files with 1046 additions and 633 deletions
29
modules/otp/test/test_api.py
Normal file
29
modules/otp/test/test_api.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import json
|
||||
from http import HTTPStatus
|
||||
|
||||
|
||||
def test_encrypt(test_client):
|
||||
body = dict(otp='asdf', plaintext='asdf')
|
||||
request, response = test_client.post('/api/otp/encrypt_otp', content=json.dumps(body))
|
||||
assert response.status_code == HTTPStatus.OK
|
||||
assert response.json == dict(
|
||||
ciphertext='AAGK',
|
||||
otp='ASDF',
|
||||
plaintext='ASDF',
|
||||
)
|
||||
|
||||
|
||||
def test_decrypt(test_client):
|
||||
body = dict(otp='asdf', ciphertext='aagk')
|
||||
request, response = test_client.post('/api/otp/decrypt_otp', content=json.dumps(body))
|
||||
assert response.status_code == HTTPStatus.OK
|
||||
assert response.json == dict(
|
||||
ciphertext='AAGK',
|
||||
otp='ASDF',
|
||||
plaintext='ASDF',
|
||||
)
|
||||
|
||||
|
||||
def test_get_pdf(test_client):
|
||||
request, response = test_client.get('/api/otp/pdf')
|
||||
assert response.status_code == HTTPStatus.OK
|
||||
Loading…
Add table
Add a link
Reference in a new issue