- 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.
59 lines
960 B
Python
59 lines
960 B
Python
"""
|
|
path_config模块测试
|
|
"""
|
|
|
|
import os
|
|
import pytest # type: ignore
|
|
from pathlib import Path
|
|
import path_config
|
|
|
|
|
|
class TestPathConfig:
|
|
"""路径配置测试类"""
|
|
|
|
def test_get_screenshot_path(self):
|
|
"""测试获取截图路径"""
|
|
path = path_config.get_screenshot_path()
|
|
assert path is not None
|
|
assert isinstance(path, str)
|
|
assert path.endswith(".png") or path.endswith("screenshot.png")
|
|
|
|
def test_get_pic_dir(self):
|
|
"""测试获取图片目录"""
|
|
pic_dir = path_config.get_pic_dir()
|
|
assert pic_dir is not None
|
|
assert isinstance(pic_dir, str)
|
|
assert os.path.isabs(pic_dir) or pic_dir.startswith("pic")
|
|
|
|
def test_paths_exist_or_creatable(self, temp_dir):
|
|
"""测试路径可以创建"""
|
|
# 这个测试需要确保路径可以创建
|
|
# 实际测试中可能需要mock文件系统操作
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|