From 66eb05e6b1234c0c95807318f25c9f202e84d00f Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 22 May 2026 01:22:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=20reservation=5Flogic.cleanup=5Fvalid?= =?UTF-8?q?ate=20=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+10=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 - validate_back_to_reservation / cleanup_expired_reservations 函数签名验证 - reservation_logic 全部 6 个子模块存在性测试 Co-Authored-By: Claude Opus 4.5 --- tests/test_reservation_logic_remaining.py | 87 +++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 tests/test_reservation_logic_remaining.py diff --git a/tests/test_reservation_logic_remaining.py b/tests/test_reservation_logic_remaining.py new file mode 100644 index 0000000..2cb00dd --- /dev/null +++ b/tests/test_reservation_logic_remaining.py @@ -0,0 +1,87 @@ +"""reservation_logic.cleanup_validate 子模块单元测试。 + +覆盖: +- validate_back_to_reservation 函数签名 +- cleanup_expired_reservations 函数签名 +""" + +from __future__ import annotations + +import inspect +import pytest + + +class TestValidateBackToReservation: + """validate_back_to_reservation 函数测试。""" + + def test_function_exists(self): + from douyin.reservation.reservation_logic.cleanup_validate import ( + validate_back_to_reservation, + ) + + assert callable(validate_back_to_reservation) + + def test_function_signature(self): + from douyin.reservation.reservation_logic.cleanup_validate import ( + validate_back_to_reservation, + ) + + sig = inspect.signature(validate_back_to_reservation) + params = list(sig.parameters.keys()) + assert "analyser" in params + assert "reservations" in params + + +class TestCleanupExpiredReservations: + """cleanup_expired_reservations 函数测试。""" + + def test_function_exists(self): + from douyin.reservation.reservation_logic.cleanup_validate import ( + cleanup_expired_reservations, + ) + + assert callable(cleanup_expired_reservations) + + def test_function_signature(self): + from douyin.reservation.reservation_logic.cleanup_validate import ( + cleanup_expired_reservations, + ) + + sig = inspect.signature(cleanup_expired_reservations) + params = list(sig.parameters.keys()) + assert "analyser" in params + assert "reservations" in params + + +class TestReservationLogicSubmodules: + """reservation_logic 子模块存在性测试。""" + + def test_cleanup_validate_importable(self): + from douyin.reservation.reservation_logic import cleanup_validate + + assert cleanup_validate is not None + + def test_helpers_importable(self): + from douyin.reservation.reservation_logic import helpers + + assert helpers is not None + + def test_add_importable(self): + from douyin.reservation.reservation_logic import add + + assert add is not None + + def test_record_importable(self): + from douyin.reservation.reservation_logic import record + + assert record is not None + + def test_queue_full_importable(self): + from douyin.reservation.reservation_logic import queue_full + + assert queue_full is not None + + def test_attend_window_importable(self): + from douyin.reservation.reservation_logic import attend_window + + assert attend_window is not None