mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2026-05-09 18:27:56 +08:00
🐛 fix config alias err
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from nonebug.app import App
|
||||
|
||||
|
||||
def test_parse_alias(app: App):
|
||||
from nonebot.compat import PYDANTIC_V2
|
||||
|
||||
from nonebot_bison.plugin_config import PlugConfig
|
||||
|
||||
if PYDANTIC_V2:
|
||||
cfg = PlugConfig.model_validate({"bison_theme_use_browser": True})
|
||||
assert cfg.bison_use_browser
|
||||
|
||||
cfg = PlugConfig.model_validate({"bison_use_browser": True})
|
||||
assert cfg.bison_use_browser
|
||||
else:
|
||||
cfg = PlugConfig.parse_obj({"bison_theme_use_browser": True})
|
||||
assert cfg.bison_use_browser
|
||||
|
||||
cfg = PlugConfig.parse_obj({"bison_use_browser": True})
|
||||
assert cfg.bison_use_browser
|
||||
Reference in New Issue
Block a user