modify test

This commit is contained in:
zhangxunhui 2021-08-15 12:53:17 +08:00
parent 5b86c829ba
commit 2bd55291f8
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,11 @@
import sys, pathlib
sys.path.append(str(pathlib.Path(__file__).resolve().parents[3]))
from app.db.operators.base_operator import BaseOperator
import pytest, aiomysql
from sqlalchemy.ext.asyncio import AsyncEngine
@pytest.mark.asyncio
async def test_base_operator() -> None:
baseOp = BaseOperator()
assert type(baseOp.engine) == AsyncEngine

View File

@ -0,0 +1,14 @@
import sys, pathlib
sys.path.append(str(pathlib.Path(__file__).resolve().parents[3]))
from app.db.operators.pull_request_operator import PullRequestOperator
import pytest
from app.models.pull_request import PullRequest
from app.models.user import User
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'))