Skip to content

Commit

Permalink
test: 统一用来测试同步的标签名称
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 committed Dec 17, 2024
1 parent 4a5eaa9 commit 153cb95
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/providers/store_test/test_store_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async def test_store_sync(
"desc": "NoneBot 数据存储插件",
"author": "he0119",
"homepage": "https://github.com/he0119/nonebot-plugin-datastore",
"tags": [{"label": "good first plugin", "color": "#ffffff"}],
"tags": [{"label": "sync", "color": "#ffffff"}],
"is_official": False,
"type": "library",
"supported_adapters": None,
Expand Down Expand Up @@ -332,7 +332,7 @@ async def test_store_sync(
"desc": "NoneBot 数据存储插件",
"author": "he0119",
"homepage": "https://github.com/he0119/nonebot-plugin-datastore",
"tags": [{"label": "good first plugin", "color": "#ffffff"}],
"tags": [{"label": "sync", "color": "#ffffff"}],
"is_official": False,
"type": "library",
"supported_adapters": None,
Expand Down Expand Up @@ -514,7 +514,7 @@ async def test_store_sync_validation_failed(
"desc": "NoneBot 数据存储插件",
"author": "he0119",
"homepage": "https://github.com/he0119/nonebot-plugin-datastore",
"tags": [{"label": "good first plugin", "color": "#ffffff"}],
"tags": [{"label": "sync", "color": "#ffffff"}],
"is_official": False,
"type": "library",
"supported_adapters": None,
Expand Down
4 changes: 2 additions & 2 deletions tests/providers/store_test/test_store_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async def test_store_test(
'[{"module_name":"~none","project_link":"","name":"None","desc":"None 驱动器","author":"yanyongyu","homepage":"/docs/advanced/driver","tags":[{"label":"sync","color":"#ffffff"}],"is_official":true,"time":"2024-10-31T13:47:14.152851Z","version":"2.4.0"},{"module_name":"~fastapi","project_link":"nonebot2[fastapi]","name":"FastAPI","desc":"FastAPI 驱动器","author":"yanyongyu","homepage":"/docs/advanced/driver","tags":[],"is_official":true,"time":"2024-10-31T13:47:14.152851Z","version":"2.4.0"},{"module_name":"~quart","project_link":"nonebot2[quart]","name":"Quart","desc":"Quart 驱动器","author":"he0119","homepage":"/docs/advanced/driver","tags":[],"is_official":true,"time":"2024-10-31T13:47:14.152851Z","version":"2.4.0"}]'
)
assert mocked_store_data["plugins"].read_text(encoding="utf-8") == snapshot(
'[{"module_name":"nonebot_plugin_datastore","project_link":"nonebot-plugin-datastore","name":"数据存储","desc":"NoneBot 数据存储插件","author":"he0119","homepage":"https://github.com/he0119/nonebot-plugin-datastore","tags":[{"label":"good first plugin","color":"#ffffff"}],"is_official":false,"type":"library","supported_adapters":null,"valid":true,"time":"2024-06-20T07:53:23.524486Z","version":"1.3.0","skip_test":false},{"module_name":"nonebot_plugin_treehelp","project_link":"nonebot-plugin-treehelp","name":"帮助","desc":"获取插件帮助信息","author":"author","homepage":"https://nonebot.dev/","tags":[],"is_official":false,"type":"application","supported_adapters":null,"valid":true,"time":"2023-08-28T00:00:00.000000+08:00","version":"0.3.0","skip_test":false}]'
'[{"module_name":"nonebot_plugin_datastore","project_link":"nonebot-plugin-datastore","name":"数据存储","desc":"NoneBot 数据存储插件","author":"he0119","homepage":"https://github.com/he0119/nonebot-plugin-datastore","tags":[{"label":"sync","color":"#ffffff"}],"is_official":false,"type":"library","supported_adapters":null,"valid":true,"time":"2024-06-20T07:53:23.524486Z","version":"1.3.0","skip_test":false},{"module_name":"nonebot_plugin_treehelp","project_link":"nonebot-plugin-treehelp","name":"帮助","desc":"获取插件帮助信息","author":"author","homepage":"https://nonebot.dev/","tags":[],"is_official":false,"type":"application","supported_adapters":null,"valid":true,"time":"2023-08-28T00:00:00.000000+08:00","version":"0.3.0","skip_test":false}]'
)
assert mocked_store_data["results"].read_text(encoding="utf-8") == snapshot(
'{"nonebot-plugin-datastore:nonebot_plugin_datastore":{"time":"2023-06-26T22:08:18.945584+08:00","config":"","version":"1.3.0","test_env":null,"results":{"validation":true,"load":true,"metadata":true},"outputs":{"validation":null,"load":"datastore","metadata":{"name":"数据存储","description":"NoneBot 数据存储插件","usage":"请参考文档","type":"library","homepage":"https://github.com/he0119/nonebot-plugin-datastore","supported_adapters":null}}},"nonebot-plugin-treehelp:nonebot_plugin_treehelp":{"time":"2023-08-28T00:00:00.000000+08:00","config":"","version":"1.0.0","test_env":null,"results":{"load":true,"metadata":true,"validation":true},"outputs":{"load":"output","metadata":{"name":"帮助","description":"获取插件帮助信息","usage":"获取插件列表\\n/help\\n获取插件树\\n/help -t\\n/help --tree\\n获取某个插件的帮助\\n/help 插件名\\n获取某个插件的树\\n/help --tree 插件名\\n","type":"application","homepage":"https://nonebot.dev/","supported_adapters":null},"validation":null}}}'
Expand Down Expand Up @@ -240,7 +240,7 @@ async def test_store_test_raise(
'[{"module_name":"~none","project_link":"","name":"None","desc":"None 驱动器","author":"yanyongyu","homepage":"/docs/advanced/driver","tags":[{"label":"sync","color":"#ffffff"}],"is_official":true,"time":"2024-10-31T13:47:14.152851Z","version":"2.4.0"},{"module_name":"~fastapi","project_link":"nonebot2[fastapi]","name":"FastAPI","desc":"FastAPI 驱动器","author":"yanyongyu","homepage":"/docs/advanced/driver","tags":[],"is_official":true,"time":"2024-10-31T13:47:14.152851Z","version":"2.4.0"},{"module_name":"~quart","project_link":"nonebot2[quart]","name":"Quart","desc":"Quart 驱动器","author":"he0119","homepage":"/docs/advanced/driver","tags":[],"is_official":true,"time":"2024-10-31T13:47:14.152851Z","version":"2.4.0"}]'
)
assert mocked_store_data["plugins"].read_text(encoding="utf-8") == snapshot(
'[{"module_name":"nonebot_plugin_datastore","project_link":"nonebot-plugin-datastore","name":"数据存储","desc":"NoneBot 数据存储插件","author":"he0119","homepage":"https://github.com/he0119/nonebot-plugin-datastore","tags":[{"label":"good first plugin","color":"#ffffff"}],"is_official":false,"type":"library","supported_adapters":null,"valid":true,"time":"2024-06-20T07:53:23.524486Z","version":"1.3.0","skip_test":false},{"module_name":"nonebot_plugin_treehelp","project_link":"nonebot-plugin-treehelp","name":"帮助","desc":"获取插件帮助信息","author":"he0119","homepage":"https://github.com/he0119/nonebot-plugin-treehelp","tags":[],"is_official":false,"type":"application","supported_adapters":null,"valid":true,"time":"2024-07-13T04:41:40.905441Z","version":"0.5.0","skip_test":false}]'
'[{"module_name":"nonebot_plugin_datastore","project_link":"nonebot-plugin-datastore","name":"数据存储","desc":"NoneBot 数据存储插件","author":"he0119","homepage":"https://github.com/he0119/nonebot-plugin-datastore","tags":[{"label":"sync","color":"#ffffff"}],"is_official":false,"type":"library","supported_adapters":null,"valid":true,"time":"2024-06-20T07:53:23.524486Z","version":"1.3.0","skip_test":false},{"module_name":"nonebot_plugin_treehelp","project_link":"nonebot-plugin-treehelp","name":"帮助","desc":"获取插件帮助信息","author":"he0119","homepage":"https://github.com/he0119/nonebot-plugin-treehelp","tags":[],"is_official":false,"type":"application","supported_adapters":null,"valid":true,"time":"2024-07-13T04:41:40.905441Z","version":"0.5.0","skip_test":false}]'
)
assert mocked_store_data["results"].read_text(encoding="utf-8") == snapshot(
'{"nonebot-plugin-datastore:nonebot_plugin_datastore":{"time":"2023-06-26T22:08:18.945584+08:00","config":"","version":"1.3.0","test_env":null,"results":{"validation":true,"load":true,"metadata":true},"outputs":{"validation":null,"load":"datastore","metadata":{"name":"数据存储","description":"NoneBot 数据存储插件","usage":"请参考文档","type":"library","homepage":"https://github.com/he0119/nonebot-plugin-datastore","supported_adapters":null}}},"nonebot-plugin-treehelp:nonebot_plugin_treehelp":{"time":"2023-06-26T22:20:41.833311+08:00","config":"","version":"0.3.0","test_env":null,"results":{"validation":true,"load":true,"metadata":true},"outputs":{"validation":null,"load":"treehelp","metadata":{"name":"帮助","description":"获取插件帮助信息","usage":"获取插件列表\\n/help\\n获取插件树\\n/help -t\\n/help --tree\\n获取某个插件的帮助\\n/help 插件名\\n获取某个插件的树\\n/help --tree 插件名\\n","type":"application","homepage":"https://github.com/he0119/nonebot-plugin-treehelp","supported_adapters":null}}}}'
Expand Down
2 changes: 1 addition & 1 deletion tests/store/store_plugins.json5
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"author_id": 1,
"tags": [
{
"label": "good first plugin",
"label": "sync",
"color": "#ffffff"
}
],
Expand Down

0 comments on commit 153cb95

Please sign in to comment.