- 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 <noreply@anthropic.com>
103 lines
3.1 KiB
Python
103 lines
3.1 KiB
Python
"""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
|