完成 Ruff 全量清理
This commit is contained in:
@@ -175,18 +175,21 @@ class TestHuyaAppLogin:
|
||||
side_effect=DfpRegistrationError("注册链超时"),
|
||||
) as m_reg,
|
||||
patch("core.huya.app_login.requests.post") as m_post,
|
||||
pytest.raises(HuyaAppLoginError),
|
||||
):
|
||||
with pytest.raises(HuyaAppLoginError):
|
||||
wup_password_login_raw("300023887", "pw")
|
||||
wup_password_login_raw("300023887", "pw")
|
||||
m_reg.assert_called_once()
|
||||
m_post.assert_not_called()
|
||||
|
||||
def test_login_cred_flow_registration_failure_is_explicit(self):
|
||||
"""login_cred_with_flow 注册失败同样包装为 HuyaAppLoginError 显式失败。"""
|
||||
with patch(
|
||||
"core.huya.app_login.register_device",
|
||||
side_effect=DfpRegistrationError("注册链 HTTP 500"),
|
||||
), pytest.raises(HuyaAppLoginError, match="注册失败"):
|
||||
with (
|
||||
patch(
|
||||
"core.huya.app_login.register_device",
|
||||
side_effect=DfpRegistrationError("注册链 HTTP 500"),
|
||||
),
|
||||
pytest.raises(HuyaAppLoginError, match="注册失败"),
|
||||
):
|
||||
login_cred_with_flow("300023887", "pw")
|
||||
|
||||
def test_router_functions(self):
|
||||
|
||||
Reference in New Issue
Block a user