From 59ac6a3abcfa9eea6b61d35ae18c53605aa84b83 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 21 May 2026 22:42:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=20flow=5Fcontrol=5Fpkg=20+=20orchestr?= =?UTF-8?q?ator=5Fpkg=20=E5=AD=90=E6=A8=A1=E5=9D=97=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=88+12=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 - find_and_open_fudai_detail 函数签名验证 - read_fudai_detail_once / read_fudai_detail_with_retries 函数签名验证 - flow_control_pkg / orchestrator_pkg 子模块存在性测试 Co-Authored-By: Claude Opus 4.5 --- tests/test_flow_orchestrator_submodules.py | 102 +++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 tests/test_flow_orchestrator_submodules.py diff --git a/tests/test_flow_orchestrator_submodules.py b/tests/test_flow_orchestrator_submodules.py new file mode 100644 index 0000000..263e58c --- /dev/null +++ b/tests/test_flow_orchestrator_submodules.py @@ -0,0 +1,102 @@ +"""douyin_flow_control_pkg + fudai_detail_orchestrator_pkg 子模块单元测试。 + +覆盖: +- find_open: find_and_open_fudai_detail 函数签名 +- read_once: read_fudai_detail_once 函数签名 +- read_with_retries: read_fudai_detail_with_retries 函数签名 +""" + +from __future__ import annotations + +import inspect +import pytest + + +class TestFindOpen: + """find_open 模块测试。""" + + def test_function_exists(self): + from douyin.core.douyin_flow_control_pkg.find_open import find_and_open_fudai_detail + + assert callable(find_and_open_fudai_detail) + + def test_function_signature(self): + from douyin.core.douyin_flow_control_pkg.find_open import find_and_open_fudai_detail + + sig = inspect.signature(find_and_open_fudai_detail) + params = list(sig.parameters.keys()) + assert "analyser" in params + + +class TestReadOnce: + """read_once 模块测试。""" + + def test_function_exists(self): + from douyin.fudai.core.fudai_detail_orchestrator_pkg.read_once import read_fudai_detail_once + + assert callable(read_fudai_detail_once) + + def test_function_signature(self): + from douyin.fudai.core.fudai_detail_orchestrator_pkg.read_once import read_fudai_detail_once + + sig = inspect.signature(read_fudai_detail_once) + params = list(sig.parameters.keys()) + assert "analyser" in params + + +class TestReadWithRetries: + """read_with_retries 模块测试。""" + + def test_function_exists(self): + from douyin.fudai.core.fudai_detail_orchestrator_pkg.read_with_retries import ( + read_fudai_detail_with_retries, + ) + + assert callable(read_fudai_detail_with_retries) + + def test_function_signature(self): + from douyin.fudai.core.fudai_detail_orchestrator_pkg.read_with_retries import ( + read_fudai_detail_with_retries, + ) + + sig = inspect.signature(read_fudai_detail_with_retries) + params = list(sig.parameters.keys()) + assert "analyser" in params + + +class TestFlowControlPkgSubmodules: + """douyin_flow_control_pkg 子模块存在性测试。""" + + def test_find_open_importable(self): + from douyin.core.douyin_flow_control_pkg import find_open + + assert find_open is not None + + def test_filter_importable(self): + from douyin.core.douyin_flow_control_pkg import filter + + assert filter is not None + + def test_no_fudai_importable(self): + from douyin.core.douyin_flow_control_pkg import no_fudai + + assert no_fudai is not None + + def test_stage_handler_importable(self): + from douyin.core.douyin_flow_control_pkg import stage_handler + + assert stage_handler is not None + + +class TestOrchestratorPkgSubmodules: + """fudai_detail_orchestrator_pkg 子模块存在性测试。""" + + def test_read_once_importable(self): + from douyin.fudai.core.fudai_detail_orchestrator_pkg import read_once + + assert read_once is not None + + def test_read_with_retries_importable(self): + from douyin.fudai.core.fudai_detail_orchestrator_pkg import read_with_retries + + assert read_with_retries is not None