mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-05-20 07:20:29 -04:00
more tests
This commit is contained in:
parent
d053e93e72
commit
615e0ca1d0
6 changed files with 103 additions and 45 deletions
28
veilid-python/tests/test_crypto.py
Normal file
28
veilid-python/tests/test_crypto.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
# Crypto veilid_python tests
|
||||
|
||||
import veilid_python
|
||||
import pytest
|
||||
from . import *
|
||||
|
||||
##################################################################
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_best_crypto_system():
|
||||
async with await veilid_python.json_api_connect(VEILID_SERVER, VEILID_SERVER_PORT, simple_update_callback) as api:
|
||||
bcs = await api.best_crypto_system()
|
||||
# let handle dangle for test
|
||||
# del bcs
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_crypto_system():
|
||||
async with await veilid_python.json_api_connect(VEILID_SERVER, VEILID_SERVER_PORT, simple_update_callback) as api:
|
||||
cs = await api.get_crypto_system(veilid_python.CryptoKind.CRYPTO_KIND_VLD0)
|
||||
# clean up handle early
|
||||
del cs
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_get_crypto_system_invalid():
|
||||
async with await veilid_python.json_api_connect(VEILID_SERVER, VEILID_SERVER_PORT, simple_update_callback) as api:
|
||||
with pytest.raises(veilid_python.VeilidAPIError):
|
||||
cs = await api.get_crypto_system(veilid_python.CryptoKind.CRYPTO_KIND_NONE)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue