Closed AkashiCoin closed 2 weeks ago
此拉取请求修复了插件商店中检查插件更新的问题。更改主要集中在改进更新检查逻辑、增强测试覆盖率以及重构一些现有代码以提高可维护性。
更改 | 详情 | 文件 |
---|---|---|
修复插件更新检查逻辑 |
|
zhenxun/builtin_plugins/plugin_store/data_source.py |
改进插件商店功能的测试覆盖率 |
|
tests/builtin_plugins/plugin_store/test_plugin_store.py |
重构代码以提高可维护性 |
|
zhenxun/builtin_plugins/plugin_store/data_source.py |
添加用于测试的示例插件文件 |
|
tests/content/plugin_store/github_sub.py tests/content/plugin_store/search_image.py tests/content/plugin_store/jitang.py |
Sourcery的总结
修复插件更新检查逻辑,并通过添加新的测试用例和重构插件加载方法来增强测试覆盖率。引入处理不存在插件的测试,并更新现有测试以使用实际的插件内容。
新功能:
错误修复:
增强:
get_loaded_plugins
,以提高代码的模块化和重用性。测试:
github_sub
、search_image
和jitang
添加新的测试文件,以提供元数据和使用信息,增强这些插件的测试覆盖率。Original summary in English
## Summary by Sourcery Fix plugin update check logic and enhance test coverage by adding new test cases and refactoring plugin loading methods. Introduce tests for handling non-existent plugins and update existing tests to use actual plugin content. New Features: - Introduce a new test case to handle scenarios where a plugin does not exist, ensuring appropriate messages are sent when attempting to add, update, or search for non-existent plugins. Bug Fixes: - Fix the logic in the version check function to correctly identify when a plugin update is available. Enhancements: - Refactor the method for retrieving loaded plugins into a separate asynchronous function `get_loaded_plugins` to improve code modularity and reuse. - Update test cases to use actual content bytes for plugin files instead of empty byte strings, ensuring more realistic test scenarios. Tests: - Add new test files for plugins `github_sub`, `search_image`, and `jitang` to provide metadata and usage information, enhancing the test coverage for these plugins.