fix(collect): handle login target close race
Tests / Python 3.11 / Windows (push) Has been cancelled

This commit is contained in:
chengma
2026-07-14 12:08:12 +08:00
parent cbfd36af56
commit f99cde8e05
11 changed files with 588 additions and 88 deletions
+20
View File
@@ -192,6 +192,26 @@ class AccountsTests(TempDirMixin, unittest.TestCase):
self.assert_removed(temp_dir)
def test_login_status_text_marks_target_failure_as_temporarily_uncertain(self):
self.assertEqual(
"登录状态暂不可确认",
accounts.login_status_text(
{
"logged_in": False,
"reason": "LOGIN_CHECK_TARGET_UNAVAILABLE",
}
),
)
self.assertEqual(
"登录状态暂不可确认",
accounts.login_status_text(
{
"logged_in": False,
"reason": "LOGIN_CHECK_FAILED: Target closed",
}
),
)
def test_duplicate_alias_raises_clear_error(self):
with self.make_temp_dir() as temp_dir:
cfg = self.make_config(temp_dir)