feat: Enhance documentation and clean up code structure
- Added comprehensive documentation for the unified screenshot and score recording process in the new markdown file. - Improved existing markdown files by adding spacing for better readability. - Cleaned up code by removing unnecessary blank lines across various scripts, enhancing overall code clarity. - Updated configuration settings to reflect recent changes and ensure consistency across the project. - Enhanced logging mechanisms to support better debugging and monitoring.
This commit is contained in:
1 parent
e68f1dd3de
commit
f92933641f
61 files changed
+103695
-1485
No files matched your search
@@ -2,32 +2,34 @@
|
||||
版本信息模块测试
|
||||
"""
|
||||
|
||||
import pytest
|
||||
import pytest # type: ignore[import-untyped]
|
||||
from version import VERSION, RELEASE_DATE, print_version_banner
|
||||
|
||||
|
||||
class TestVersion:
|
||||
"""版本信息测试类"""
|
||||
|
||||
|
||||
def test_version_exists(self):
|
||||
"""测试版本号存在"""
|
||||
assert VERSION is not None
|
||||
assert isinstance(VERSION, str)
|
||||
assert len(VERSION) > 0
|
||||
|
||||
|
||||
def test_version_format(self):
|
||||
"""测试版本号格式(应该是 x.y.z 格式)"""
|
||||
parts = VERSION.split(".")
|
||||
assert len(parts) >= 2, "版本号应该至少包含主版本号和次版本号"
|
||||
for part in parts:
|
||||
assert part.isdigit() or part.replace("-", "").isdigit(), f"版本号部分 '{part}' 应该是数字"
|
||||
|
||||
assert (
|
||||
part.isdigit() or part.replace("-", "").isdigit()
|
||||
), f"版本号部分 '{part}' 应该是数字"
|
||||
|
||||
def test_release_date_exists(self):
|
||||
"""测试发布日期存在"""
|
||||
assert RELEASE_DATE is not None
|
||||
assert isinstance(RELEASE_DATE, str)
|
||||
assert len(RELEASE_DATE) > 0
|
||||
|
||||
|
||||
def test_release_date_format(self):
|
||||
"""测试发布日期格式(应该是 YYYY-MM-DD 格式)"""
|
||||
parts = RELEASE_DATE.split("-")
|
||||
@@ -35,27 +37,10 @@ class TestVersion:
|
||||
assert len(parts[0]) == 4, "年份应该是4位数字"
|
||||
assert len(parts[1]) == 2, "月份应该是2位数字"
|
||||
assert len(parts[2]) == 2, "日期应该是2位数字"
|
||||
|
||||
|
||||
def test_print_version_banner(self, capsys):
|
||||
"""测试版本信息打印"""
|
||||
print_version_banner()
|
||||
captured = capsys.readouterr()
|
||||
assert VERSION in captured.out
|
||||
assert RELEASE_DATE in captured.out
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user