feat: 黄豆登录后自动签到领积分

This commit is contained in:
Nixevol
2026-10-25 06:08:44 +08:00
parent 2286bc597d
commit fd9b155518
4 changed files with 84 additions and 2 deletions
+14
View File
@@ -115,6 +115,19 @@ def test_saved_accounts_roundtrip() -> None:
assert accounts_module.load()[0]["password"] == "secret-one"
def test_sign_only_when_today_is_open() -> None:
from server.services.huangdou.login import _sign_message, _signed_today
assert not _signed_today(None)
assert not _signed_today("n")
assert not _signed_today("0")
assert _signed_today("y")
assert _signed_today("Y")
assert _signed_today(True)
assert _sign_message({"prize_name": "金币", "prize_num": 10}) == "签到成功,获得 金币 × 10"
assert _sign_message({"msg": "已经签过了"}) == "已经签过了"
def test_host_keeps_scheme() -> None:
assert normalize_host("pmihlvee.cc") == "https://pmihlvee.cc"
assert normalize_host("https://example.com/") == "https://example.com"
@@ -126,5 +139,6 @@ if __name__ == "__main__":
test_payment_and_episode_choice()
test_account_login_reuses_the_same_device_fingerprint()
test_saved_accounts_roundtrip()
test_sign_only_when_today_is_open()
test_host_keeps_scheme()
print("ok")