Squashed 'paste-framework/' content from commit 34e8684
git-subtree-dir: paste-framework git-subtree-split: 34e8684c4bc3cebbe177509f42ab4ef5b5425a7a
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
数据库集成测试。
|
||||
需要真实数据库连接,默认跳过。
|
||||
通过 `--run-integration` 参数运行。
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
from paste.db.basetable import BaseTable
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
class TestDatabaseIntegration:
|
||||
"""数据库集成测试"""
|
||||
|
||||
@pytest.mark.skip(reason="需要真实数据库连接")
|
||||
@pytest.mark.asyncio
|
||||
async def test_tables_in_db(self):
|
||||
"""测试获取数据库表列表"""
|
||||
tables = await BaseTable.tables_in_db()
|
||||
assert isinstance(tables, list)
|
||||
|
||||
@pytest.mark.skip(reason="需要真实数据库连接")
|
||||
@pytest.mark.asyncio
|
||||
async def test_is_table_exist(self):
|
||||
"""测试表存在性判断"""
|
||||
exists = await BaseTable.is_table_exist('hat_article')
|
||||
assert isinstance(exists, bool)
|
||||
Reference in New Issue
Block a user