mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-03 01:12:15 +00:00
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com> Co-authored-by: lcx01800250 <lcx01800250@alibaba-inc.com> Co-authored-by: licunxing <864255598@qq.com> Co-authored-by: Aralhi <xiaoping0501@gmail.com> Co-authored-by: xuyuan23 <643854343@qq.com> Co-authored-by: aries_ckt <916701291@qq.com> Co-authored-by: hzh97 <2976151305@qq.com>
99 lines
1.7 KiB
Python
99 lines
1.7 KiB
Python
import pytest
|
|
|
|
from dbgpt.storage.metadata import db
|
|
|
|
from ..api.schemas import ServeRequest, ServerResponse
|
|
from ..config import ServeConfig
|
|
from ..models.models import ServeDao, ServeEntity
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def setup_and_teardown():
|
|
db.init_db("sqlite:///:memory:")
|
|
db.create_all()
|
|
|
|
yield
|
|
|
|
|
|
@pytest.fixture
|
|
def server_config():
|
|
# TODO : build your server config
|
|
return ServeConfig()
|
|
|
|
|
|
@pytest.fixture
|
|
def dao(server_config):
|
|
return ServeDao(server_config)
|
|
|
|
|
|
@pytest.fixture
|
|
def default_entity_dict():
|
|
# TODO: build your default entity dict
|
|
return {}
|
|
|
|
|
|
def test_table_exist():
|
|
assert ServeEntity.__tablename__ in db.metadata.tables
|
|
|
|
|
|
def test_entity_create(default_entity_dict):
|
|
pass
|
|
|
|
|
|
def test_entity_unique_key(default_entity_dict):
|
|
# TODO: implement your test case
|
|
pass
|
|
|
|
|
|
def test_entity_get(default_entity_dict):
|
|
# TODO: implement your test case
|
|
pass
|
|
|
|
|
|
def test_entity_update(default_entity_dict):
|
|
# TODO: implement your test case
|
|
pass
|
|
|
|
|
|
def test_entity_delete(default_entity_dict):
|
|
# TODO: implement your test case
|
|
pass
|
|
|
|
|
|
def test_entity_all():
|
|
# TODO: implement your test case
|
|
pass
|
|
|
|
|
|
def test_dao_create(dao, default_entity_dict):
|
|
# TODO: implement your test case
|
|
pass
|
|
|
|
|
|
def test_dao_get_one(dao, default_entity_dict):
|
|
# TODO: implement your test case
|
|
pass
|
|
|
|
|
|
def test_get_dao_get_list(dao):
|
|
# TODO: implement your test case
|
|
pass
|
|
|
|
|
|
def test_dao_update(dao, default_entity_dict):
|
|
# TODO: implement your test case
|
|
pass
|
|
|
|
|
|
def test_dao_delete(dao, default_entity_dict):
|
|
# TODO: implement your test case
|
|
pass
|
|
|
|
|
|
def test_dao_get_list_page(dao):
|
|
# TODO: implement your test case
|
|
pass
|
|
|
|
|
|
# Add more test cases according to your own logic
|