新增完善测试模板

This commit is contained in:
2026-05-03 17:52:52 +08:00
parent 07fa0b0038
commit dd6236866e
26 changed files with 1319 additions and 5 deletions

View File

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# 样例:复制为 test_real_rpa_contract.py需 OPENCLAW_TEST_TARGET=real_rpa 且 ALLOW_REAL_RPA=1。
"""
真实 RPA / 桌面自动化(**最高风险**,仅手动触发)。
默认只读思路示例:打开沙箱门户、读取标题、**不提交表单**。
任何写操作必须 ``should_skip_profile('real_rpa', write=True)`` 且 ``ALLOW_WRITE_ACTIONS=1``。
"""
from __future__ import annotations
import unittest
from adapter_test_utils import should_skip_profile
class TestRealRpaContractSample(unittest.TestCase):
def test_skip_by_default(self) -> None:
skip, reason = should_skip_profile("real_rpa", write=False)
if skip:
raise unittest.SkipTest(reason)
# 真实技能中:连接企业沙箱门户,执行只读断言;禁止默认操作生产系统。
self.assertFalse(skip)
if __name__ == "__main__":
unittest.main()