Fix reservation direct attend timing guard
This commit is contained in:
1 parent
8fac904ba9
commit
b533c4e96e
8 files changed
+609
-22
No files matched your search
@@ -8,6 +8,8 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -93,6 +95,32 @@ class TestDouyinReservation:
|
||||
|
||||
assert callable(write_reservations_state)
|
||||
|
||||
def test_write_reservations_state_preserves_button_fields(self, tmp_path):
|
||||
from douyin.reservation.douyin_reservation import write_reservations_state
|
||||
|
||||
state_path = tmp_path / "reservations.json"
|
||||
write_reservations_state(
|
||||
state_path=str(state_path),
|
||||
reservations=[
|
||||
{
|
||||
"future_ts": 9999999999.0,
|
||||
"prize_value_yuan": 899.0,
|
||||
"content": "X",
|
||||
"button_text": "一键发表评论",
|
||||
"button_status": "需要评论",
|
||||
}
|
||||
],
|
||||
room_pos=1,
|
||||
current_room_title="room",
|
||||
current_room_title_raw="room",
|
||||
reason="unit",
|
||||
)
|
||||
|
||||
data = json.loads(state_path.read_text(encoding="utf-8"))
|
||||
item = data["reservations"][0]
|
||||
assert item["button_text"] == "一键发表评论"
|
||||
assert item["button_status"] == "需要评论"
|
||||
|
||||
def test_load_high_value_rooms_map_exists(self):
|
||||
from douyin.reservation.douyin_reservation import load_high_value_rooms_map
|
||||
|
||||
|
||||
Reference in new issue
Block a user