modified test

This commit is contained in:
zhangxunhui 2021-08-15 13:40:41 +08:00
parent 2bd55291f8
commit 76ffdc9afe
8 changed files with 2 additions and 23 deletions

View File

@ -1,11 +0,0 @@
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

View File

@ -2,7 +2,7 @@ import sys, pathlib
sys.path.append(str(pathlib.Path(__file__).resolve().parents[3]))
from app.db.operators.base_operator import BaseOperator
import pytest, aiomysql
import pytest
from sqlalchemy.ext.asyncio import AsyncEngine
@pytest.mark.asyncio

View File

@ -9,6 +9,5 @@ from app.models.repository import Repository
@pytest.mark.asyncio
async def test_insert_pull_requests() -> None:
prOp = PullRequestOperator()
await prOp.insert_pull_request(PullRequest(owner=User("test2"), repo=Repository("test2"), number=1, state="test2", locked=False, created_at='2020-01-01 00:00:00', updated_at='2020-01-01 00:00:00'))
await prOp.insert_pull_request(PullRequest(owner=User("zxh2"), repo=Repository("test"), number=1, state="open", locked=1, created_at='2020-01-01 00:00:00'))

View File

@ -1,2 +0,0 @@
import sys, pathlib
sys.path.append(str(pathlib.Path(__file__).resolve().parents[2]))

View File

@ -1,7 +0,0 @@
import sys, pathlib
sys.path.append(str(pathlib.Path(__file__).resolve().parents[2]))
from app.models.trigger import *
def test_pr_trigger():
pass