Files
douyin_guaji-main/tests/integration/test_fudai_analyse_init.py
T
Your Name e68f1dd3de feat: Refactor coverage management and enhance logging functionality
- Removed the `.coverage` file from the repository to streamline coverage management.
- Updated `.gitignore` to exclude coverage-related files and directories, ensuring a cleaner project structure.
- Introduced new scripts for checking GPU availability and detecting GUI parameter conflicts, enhancing the overall functionality of the application.
- Improved logging mechanisms across various modules to support better debugging and monitoring.
- Added comprehensive documentation for new features and updated existing markdown files for clarity.
2025-12-23 02:38:51 +08:00

62 lines
1.5 KiB
Python

"""
fudai_analyse初始化集成测试
"""
import pytest
from douyin_fudai import fudai_analyse
@pytest.mark.integration
class TestFudaiAnalyseInit:
"""fudai_analyse初始化测试"""
def test_init_default_values(self):
"""测试默认初始化值"""
analyser = fudai_analyse()
# 验证默认值
assert analyser.device_id == ""
assert analyser.y_pianyi == 0
assert analyser.resolution_ratio_x == 1080
assert analyser.resolution_ratio_y == 2400
assert analyser.last_fudai_x == 0
assert analyser._no_attend_timeout_minutes == 30.0
def test_init_has_operation(self):
"""测试operation对象已初始化"""
analyser = fudai_analyse()
assert analyser.operation is not None
assert hasattr(analyser.operation, "get_screenshot")
assert hasattr(analyser.operation, "click")
def test_init_has_log_kv(self):
"""测试日志方法已初始化"""
analyser = fudai_analyse()
assert hasattr(analyser, "_log_kv")
assert callable(analyser._log_kv)
def test_init_constants(self):
"""测试类常量已定义"""
analyser = fudai_analyse()
assert hasattr(analyser.__class__, "MAX_BACK_CLICKS_TO_RECOMMEND")
assert analyser.__class__.MAX_BACK_CLICKS_TO_RECOMMEND == 10
assert hasattr(analyser.__class__, "BACK_KEY_CLICK_DELAY")
assert analyser.__class__.BACK_KEY_CLICK_DELAY == 1.0