# -*- coding: utf-8 -*- """ Amazon 仿真 Reports RPA 联调契约样例(不进入默认 unittest 套件)。 用法(需账号 + 浏览器 + OPENCLAW_TEST_TARGET=simulator_rpa): copy tests\\integration\\test_simulator_rpa_contract.py.sample \\ tests\\integration\\test_simulator_rpa_contract.py set OPENCLAW_TEST_TARGET=simulator_rpa python tests\\integration\\test_simulator_rpa_contract.py """ from __future__ import annotations import os import sys import unittest _TESTS_DIR = os.path.dirname(os.path.abspath(__file__)) _SKILL_ROOT = os.path.abspath(os.path.join(_TESTS_DIR, "..", "..")) _SCRIPTS = os.path.join(_SKILL_ROOT, "scripts") for _p in (_SCRIPTS, _TESTS_DIR): if _p not in sys.path: sys.path.insert(0, _p) from jiangchang_skill_core import config # noqa: E402 from service.task_service import cmd_run # noqa: E402 @unittest.skipUnless( os.environ.get("OPENCLAW_TEST_TARGET") == "simulator_rpa", "requires OPENCLAW_TEST_TARGET=simulator_rpa", ) class TestSimulatorRpaContract(unittest.TestCase): def test_run_downloads_settlement_xlsx(self) -> None: config.reset_cache() rc = cmd_run(date_from="2025-12-01", date_to="2025-12-31") self.assertEqual(rc, 0) if __name__ == "__main__": unittest.main()