mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-13 20:38:39 +08:00
🚚 修改 nonebot_bison 项目结构 (#211)
* 🎨 修改 nonebot_bison 目录位置 * auto fix by pre-commit hooks * 🚚 fix frontend build target * 🚚 use soft link * Revert "🚚 use soft link" This reverts commit de21f79d5ae1bd5515b04f42a4138cb25ddf3e62. * 🚚 modify dockerfile --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: felinae98 <731499577@qq.com>
This commit is contained in:
@@ -3,13 +3,14 @@ from nonebug.app import App
|
||||
|
||||
|
||||
async def test_add_subscribe(app: App, init_scheduler):
|
||||
from nonebot_bison.config.db_config import config
|
||||
from nonebot_bison.config.db_model import Subscribe, Target, User
|
||||
from nonebot_bison.types import Target as TTarget
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
from sqlalchemy.ext.asyncio.session import AsyncSession
|
||||
from sqlalchemy.sql.expression import select
|
||||
|
||||
from nonebot_bison.config.db_config import config
|
||||
from nonebot_bison.config.db_model import Subscribe, Target, User
|
||||
from nonebot_bison.types import Target as TTarget
|
||||
|
||||
await config.add_subscribe(
|
||||
user=123,
|
||||
user_type="group",
|
||||
@@ -98,14 +99,15 @@ async def test_add_dup_sub(init_scheduler):
|
||||
|
||||
|
||||
async def test_del_subsribe(init_scheduler):
|
||||
from nonebot_bison.config.db_config import config
|
||||
from nonebot_bison.config.db_model import Subscribe, Target
|
||||
from nonebot_bison.types import Target as TTarget
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
from sqlalchemy.ext.asyncio.session import AsyncSession
|
||||
from sqlalchemy.sql.expression import select
|
||||
from sqlalchemy.sql.functions import func
|
||||
|
||||
from nonebot_bison.config.db_config import config
|
||||
from nonebot_bison.config.db_model import Subscribe, Target
|
||||
from nonebot_bison.types import Target as TTarget
|
||||
|
||||
await config.add_subscribe(
|
||||
user=123,
|
||||
user_type="group",
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
async def test_migration(use_legacy_config):
|
||||
from nonebot_plugin_datastore.db import init_db
|
||||
|
||||
from nonebot_bison.config.config_legacy import config as config_legacy
|
||||
from nonebot_bison.config.db_config import config
|
||||
from nonebot_plugin_datastore.db import init_db
|
||||
|
||||
config_legacy.add_subscribe(
|
||||
user=123,
|
||||
@@ -54,9 +55,10 @@ async def test_migration(use_legacy_config):
|
||||
|
||||
|
||||
async def test_migrate_dup(use_legacy_config):
|
||||
from nonebot_plugin_datastore.db import init_db
|
||||
|
||||
from nonebot_bison.config.config_legacy import config as config_legacy
|
||||
from nonebot_bison.config.db_config import config
|
||||
from nonebot_plugin_datastore.db import init_db
|
||||
|
||||
config_legacy.add_subscribe(
|
||||
user=123,
|
||||
|
||||
@@ -5,10 +5,11 @@ from pytest_mock import MockerFixture
|
||||
|
||||
|
||||
async def test_create_config(init_scheduler):
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
|
||||
from nonebot_bison.config.db_config import TimeWeightConfig, WeightConfig, config
|
||||
from nonebot_bison.config.db_model import Subscribe, Target, User
|
||||
from nonebot_bison.types import Target as T_Target
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
|
||||
await config.add_subscribe(
|
||||
user=123,
|
||||
@@ -56,11 +57,12 @@ async def test_create_config(init_scheduler):
|
||||
async def test_get_current_weight(init_scheduler, mocker: MockerFixture):
|
||||
from datetime import time
|
||||
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
|
||||
from nonebot_bison.config import db_config
|
||||
from nonebot_bison.config.db_config import TimeWeightConfig, WeightConfig, config
|
||||
from nonebot_bison.config.db_model import Subscribe, Target, User
|
||||
from nonebot_bison.types import Target as T_Target
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
|
||||
await config.add_subscribe(
|
||||
user=123,
|
||||
@@ -121,13 +123,14 @@ async def test_get_current_weight(init_scheduler, mocker: MockerFixture):
|
||||
|
||||
|
||||
async def test_get_platform_target(app: App, init_scheduler):
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
from sqlalchemy.ext.asyncio.session import AsyncSession
|
||||
from sqlalchemy.sql.expression import select
|
||||
|
||||
from nonebot_bison.config import db_config
|
||||
from nonebot_bison.config.db_config import TimeWeightConfig, WeightConfig, config
|
||||
from nonebot_bison.config.db_model import Subscribe, Target, User
|
||||
from nonebot_bison.types import Target as T_Target
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
from sqlalchemy.ext.asyncio.session import AsyncSession
|
||||
from sqlalchemy.sql.expression import select
|
||||
|
||||
await config.add_subscribe(
|
||||
user=123,
|
||||
@@ -171,15 +174,16 @@ async def test_get_platform_target(app: App, init_scheduler):
|
||||
|
||||
|
||||
async def test_get_platform_target_subscribers(app: App, init_scheduler):
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
from sqlalchemy.ext.asyncio.session import AsyncSession
|
||||
from sqlalchemy.sql.expression import select
|
||||
|
||||
from nonebot_bison.config import db_config
|
||||
from nonebot_bison.config.db_config import TimeWeightConfig, WeightConfig, config
|
||||
from nonebot_bison.config.db_model import Subscribe, Target, User
|
||||
from nonebot_bison.types import Target as T_Target
|
||||
from nonebot_bison.types import User as T_User
|
||||
from nonebot_bison.types import UserSubInfo
|
||||
from nonebot_plugin_datastore.db import get_engine
|
||||
from sqlalchemy.ext.asyncio.session import AsyncSession
|
||||
from sqlalchemy.sql.expression import select
|
||||
|
||||
await config.add_subscribe(
|
||||
user=123,
|
||||
|
||||
Reference in New Issue
Block a user