补 douyin_yanghao_pkg 剩余子模块单元测试(+7 用例)
- _scaled_click / _do_comment 函数签名验证 - douyin_yanghao_pkg 全部 3 个子模块存在性测试 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
266c7f2932
commit
5a40b49727
1 file changed
+59
@@ -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
|
||||
Reference in new issue
Block a user