add test for async function
This commit is contained in:
parent
915f8a3ae2
commit
98860b6961
|
@ -0,0 +1,11 @@
|
|||
import sys, pathlib
|
||||
sys.path.append(str(pathlib.Path(__file__).resolve().parents[2]))
|
||||
|
||||
from app.db.events import connect_to_db
|
||||
from app.utils.global_variables import GlobalVariable
|
||||
import pytest, aiomysql
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_connect_to_db() -> None:
|
||||
await connect_to_db()
|
||||
assert type(GlobalVariable.dbPool) == aiomysql.pool.Pool
|
|
@ -1,7 +0,0 @@
|
|||
import sys, pathlib
|
||||
sys.path.append(str(pathlib.Path(__file__).resolve().parents[2]))
|
||||
|
||||
from app.services.authentication import auth
|
||||
|
||||
def test_auth_func() -> None:
|
||||
auth()
|
Loading…
Reference in New Issue