feat: 工资查询助手首版 v1.0.105
基于 skill-template 脚手架开发,包含: - payroll_config(费率配置,可编辑)+ payslip_snapshots(解析历史,只读)2 张业务表 - 全国默认 + 北上广 4 套费率(社保/公积金/个税起征点/7 级税率表) - 5 个业务 Action:calculate-payslip-simple / calculate-payslip-full / explain-term / view-config / edit-config - 个税累计预扣法计算,支持多月历史累加 - 20 个薪资名词库(社保/公积金/个税/全勤/加班费等) - 完整市场文档(README/TUTORIAL/DEMO/CHANGELOG) - 296 测试全部通过
This commit is contained in:
34
examples/real_browser_rpa/tests/test_stop_reason.py
Normal file
34
examples/real_browser_rpa/tests/test_stop_reason.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""stop_reason 用户友好文案单元测试。"""
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
|
||||
from service.task_rpa import format_stop_reason_for_user
|
||||
|
||||
|
||||
class TestFormatStopReasonForUser(unittest.TestCase):
|
||||
def test_max_items(self) -> None:
|
||||
msg = format_stop_reason_for_user("max_items", 100)
|
||||
self.assertIn("默认采集规模", msg)
|
||||
self.assertIn("100", msg)
|
||||
|
||||
def test_end_marker(self) -> None:
|
||||
msg = format_stop_reason_for_user("end_marker", 42)
|
||||
self.assertIn("没有更多结果", msg)
|
||||
|
||||
def test_no_new_rounds(self) -> None:
|
||||
msg = format_stop_reason_for_user("no_new_rounds", 30)
|
||||
self.assertIn("连续多次加载没有发现新结果", msg)
|
||||
|
||||
def test_max_scrolls(self) -> None:
|
||||
msg = format_stop_reason_for_user("max_scrolls", 80)
|
||||
self.assertIn("页面加载保护范围", msg)
|
||||
|
||||
def test_none_or_unknown(self) -> None:
|
||||
self.assertEqual(format_stop_reason_for_user(None, 10), "本次采集已完成。")
|
||||
self.assertEqual(format_stop_reason_for_user("unknown", 10), "本次采集已完成。")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user