Skip to content

Commit ec11579

Browse files
authored
fix(store_test): 修正字段名称为 skip_test (#174)
1 parent fd12e5e commit ec11579

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- 修正字段名称为 skip_test
13+
1014
## [3.0.1] - 2023-08-28
1115

1216
### Fixed

src/utils/store_test/store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def should_skip(self, key: str) -> bool:
8787
def skip_plugin_test(self, key: str) -> bool:
8888
"""是否跳过插件测试"""
8989
if key in self._previous_plugins:
90-
return self._previous_plugins[key].get("skip_plugin_test", False)
90+
return self._previous_plugins[key].get("skip_test", False)
9191
return False
9292

9393
async def run(

src/utils/store_test/validation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def extract_version(path: Path) -> str | None:
3333

3434

3535
async def validate_plugin(
36-
plugin: StorePlugin, config: str, skip_plugin_test: bool, data: str | None = None
36+
plugin: StorePlugin, config: str, skip_test: bool, data: str | None = None
3737
) -> tuple[TestResult, Plugin | None]:
3838
"""验证插件
3939
@@ -51,7 +51,7 @@ async def validate_plugin(
5151

5252
# 如果传递了 data 参数
5353
# 则直接使用 data 作为插件数据
54-
# 并且将 skip_plugin_test 设置为 True
54+
# 并且将 skip_test 设置为 True
5555
if data:
5656
# 无法获取到插件版本
5757
version = None
@@ -66,7 +66,7 @@ async def validate_plugin(
6666
new_plugin["valid"] = True
6767
new_plugin["version"] = version
6868
new_plugin["time"] = now_str
69-
new_plugin["skip_plugin_test"] = True
69+
new_plugin["skip_test"] = True
7070
new_plugin = cast(Plugin, new_plugin)
7171

7272
metadata = {
@@ -95,7 +95,7 @@ async def validate_plugin(
9595
shutil.rmtree(test.path)
9696

9797
# 当跳过测试的插件首次通过加载测试,则不再标记为跳过测试
98-
should_skip = False if plugin_test_result else skip_plugin_test
98+
should_skip = False if plugin_test_result else skip_test
9999

100100
raw_data = {
101101
"module_name": module_name,
@@ -125,7 +125,7 @@ async def validate_plugin(
125125
new_plugin["valid"] = validation_info_result["valid"]
126126
new_plugin["version"] = version
127127
new_plugin["time"] = now_str
128-
new_plugin["skip_plugin_test"] = should_skip
128+
new_plugin["skip_test"] = should_skip
129129
new_plugin = cast(Plugin, new_plugin)
130130
else:
131131
new_plugin = None

tests/utils/store_test/test_validate_plugin.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ async def test_validate_plugin(
8383
"type": "application",
8484
"valid": True,
8585
"version": "0.3.0",
86-
"skip_plugin_test": False,
86+
"skip_test": False,
8787
}
8888

8989
assert mocked_api["homepage"].called
@@ -166,7 +166,7 @@ async def test_validate_plugin_with_data(
166166
"time": "2023-08-23T09:22:14.836035+08:00",
167167
"valid": True,
168168
"version": None,
169-
"skip_plugin_test": True,
169+
"skip_test": True,
170170
}
171171

172172
assert not mocked_api["homepage"].called
@@ -179,7 +179,7 @@ async def test_validate_plugin_skip_test(
179179
) -> None:
180180
"""跳过插件测试的情况
181181
182-
如果插件之前是跳过测试的,如果插件测试成功,应将 skip_plugin_test 设置为 False。
182+
如果插件之前是跳过测试的,如果插件测试成功,应将 skip_test 设置为 False。
183183
"""
184184
from src.utils.store_test.validation import StorePlugin, validate_plugin
185185

@@ -252,7 +252,7 @@ async def test_validate_plugin_skip_test(
252252
"type": "application",
253253
"valid": True,
254254
"version": "0.3.0",
255-
"skip_plugin_test": False,
255+
"skip_test": False,
256256
}
257257

258258
assert mocked_api["homepage"].called
@@ -266,7 +266,7 @@ async def test_validate_plugin_skip_test_plugin_test_failed(
266266
) -> None:
267267
"""跳过插件测试的情况
268268
269-
如果插件之前是跳过测试的,如果插件测试失败,应不改变 skip_plugin_test 的值。
269+
如果插件之前是跳过测试的,如果插件测试失败,应不改变 skip_test 的值。
270270
"""
271271
from src.utils.store_test.validation import StorePlugin, validate_plugin
272272

@@ -339,7 +339,7 @@ async def test_validate_plugin_skip_test_plugin_test_failed(
339339
"type": "application",
340340
"valid": True,
341341
"version": "0.3.0",
342-
"skip_plugin_test": True,
342+
"skip_test": True,
343343
}
344344

345345
assert mocked_api["homepage"].called

0 commit comments

Comments
 (0)