增加了群id和私聊id的显示

This commit is contained in:
Prometheus-first
2026-10-16 12:26:23 +08:00
parent 68eb19ea35
commit 516e82483d
5 changed files with 110 additions and 15 deletions
+16
View File
@@ -178,6 +178,22 @@ class AccountTests(unittest.TestCase):
with self.assertRaisesRegex(RuntimeError, "自动等待"):
service._prepare_channel()
@unittest.skipUnless(sys.platform == "win32", "本机原生服务检查")
def test_start_logs_identity_read_from_current_process(self):
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "native"))
from text_service import NativeTextService
service = NativeTextService(pid=123)
def prepare_channel():
service.router.set_account(SELF)
return True
with patch("filehelper_service.NativeFileHelperService.start", side_effect=prepare_channel), \
self.assertLogs("NativeText", "INFO") as captured:
self.assertTrue(service.start())
self.assertIn(SELF, "\n".join(captured.output))
self.assertIn("当前登录微信ID", "\n".join(captured.output))
@unittest.skipUnless(sys.platform == "win32", "本机原生服务检查")
def test_explicit_wrong_pid_is_rejected_before_loading_bridge(self):
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "native"))