(tmp_path: Path)
| 93 | |
| 94 | |
| 95 | def test_load_plugin_metadata_includes_i18n(tmp_path: Path): |
| 96 | plugin_path = tmp_path / "helloworld" |
| 97 | _write_local_test_plugin(plugin_path, TEST_PLUGIN_REPO) |
| 98 | i18n_path = plugin_path / ".astrbot-plugin" / "i18n" |
| 99 | i18n_path.mkdir(parents=True) |
| 100 | (i18n_path / "zh-CN.json").write_text( |
| 101 | json.dumps({"metadata": {"display_name": "你好世界"}}, ensure_ascii=False), |
| 102 | encoding="utf-8", |
| 103 | ) |
| 104 | |
| 105 | metadata = PluginManager._load_plugin_metadata(str(plugin_path)) |
| 106 | |
| 107 | assert metadata is not None |
| 108 | assert metadata.short_desc == "Local test short description" |
| 109 | assert metadata.pages == [] |
| 110 | assert metadata.i18n == {"zh-CN": {"metadata": {"display_name": "你好世界"}}} |
| 111 | |
| 112 | |
| 113 | def test_load_plugin_metadata_includes_pages(tmp_path: Path): |
nothing calls this directly
no test coverage detected