From 5a40b49727e63880bca51f4f95d9c63696e9fa11 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 21 May 2026 22:48:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=20douyin=5Fyanghao=5Fpkg=20=E5=89=A9?= =?UTF-8?q?=E4=BD=99=E5=AD=90=E6=A8=A1=E5=9D=97=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=EF=BC=88+7=20=E7=94=A8=E4=BE=8B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - _scaled_click / _do_comment 函数签名验证 - douyin_yanghao_pkg 全部 3 个子模块存在性测试 Co-Authored-By: Claude Opus 4.5 --- tests/test_yanghao_pkg_remaining.py | 59 +++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 tests/test_yanghao_pkg_remaining.py diff --git a/tests/test_yanghao_pkg_remaining.py b/tests/test_yanghao_pkg_remaining.py new file mode 100644 index 0000000..13a3f2b --- /dev/null +++ b/tests/test_yanghao_pkg_remaining.py @@ -0,0 +1,59 @@ +"""douyin_yanghao_pkg 剩余子模块单元测试。 + +覆盖: +- click_helpers: _scaled_click, _do_comment 函数签名 +""" + +from __future__ import annotations + +import inspect +import pytest + + +class TestClickHelpers: + """click_helpers 模块测试。""" + + def test_scaled_click_exists(self): + from douyin.other.douyin_yanghao_pkg.click_helpers import _scaled_click + + assert callable(_scaled_click) + + def test_scaled_click_signature(self): + from douyin.other.douyin_yanghao_pkg.click_helpers import _scaled_click + + sig = inspect.signature(_scaled_click) + params = list(sig.parameters.keys()) + assert "analyser" in params + assert "base_x" in params + assert "base_y" in params + + def test_do_comment_exists(self): + from douyin.other.douyin_yanghao_pkg.click_helpers import _do_comment + + assert callable(_do_comment) + + def test_do_comment_signature(self): + from douyin.other.douyin_yanghao_pkg.click_helpers import _do_comment + + sig = inspect.signature(_do_comment) + params = list(sig.parameters.keys()) + assert "analyser" in params + + +class TestYanghaoPkgSubmodules: + """douyin_yanghao_pkg 子模块存在性测试。""" + + def test_click_helpers_importable(self): + from douyin.other.douyin_yanghao_pkg import click_helpers + + assert click_helpers is not None + + def test_entrypoints_importable(self): + from douyin.other.douyin_yanghao_pkg import entrypoints + + assert entrypoints is not None + + def test_logger_importable(self): + from douyin.other.douyin_yanghao_pkg import logger + + assert logger is not None