feat: 黄豆登录后自动签到领积分
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user