mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-15 14:11:14 +00:00
feat(model): Proxy model support count token (#996)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
from typing import List
|
||||
|
||||
import pytest
|
||||
|
||||
from dbgpt.storage.metadata import db
|
||||
@@ -39,11 +37,9 @@ def test_table_exist():
|
||||
|
||||
|
||||
def test_entity_create(default_entity_dict):
|
||||
entity: ServeEntity = ServeEntity.create(**default_entity_dict)
|
||||
# TODO: implement your test case
|
||||
with db.session() as session:
|
||||
db_entity: ServeEntity = session.query(ServeEntity).get(entity.id)
|
||||
assert db_entity.id == entity.id
|
||||
entity = ServeEntity(**default_entity_dict)
|
||||
session.add(entity)
|
||||
|
||||
|
||||
def test_entity_unique_key(default_entity_dict):
|
||||
@@ -52,10 +48,8 @@ def test_entity_unique_key(default_entity_dict):
|
||||
|
||||
|
||||
def test_entity_get(default_entity_dict):
|
||||
entity: ServeEntity = ServeEntity.create(**default_entity_dict)
|
||||
db_entity: ServeEntity = ServeEntity.get(entity.id)
|
||||
assert db_entity.id == entity.id
|
||||
# TODO: implement your test case
|
||||
pass
|
||||
|
||||
|
||||
def test_entity_update(default_entity_dict):
|
||||
@@ -65,10 +59,7 @@ def test_entity_update(default_entity_dict):
|
||||
|
||||
def test_entity_delete(default_entity_dict):
|
||||
# TODO: implement your test case
|
||||
entity: ServeEntity = ServeEntity.create(**default_entity_dict)
|
||||
entity.delete()
|
||||
db_entity: ServeEntity = ServeEntity.get(entity.id)
|
||||
assert db_entity is None
|
||||
pass
|
||||
|
||||
|
||||
def test_entity_all():
|
||||
|
Reference in New Issue
Block a user