25 lines
912 B
Plaintext
25 lines
912 B
Plaintext
# -*- coding: utf-8 -*-
|
|
# 样例:复制为 test_simulator_api_contract.py 后,在 OPENCLAW_TEST_TARGET=simulator_api 下用 pytest 或 unittest 运行。
|
|
"""仿真 HTTP API 契约(默认跳过;不引入 requests 运行时依赖)。"""
|
|
from __future__ import annotations
|
|
|
|
import unittest
|
|
|
|
from adapter_test_utils import should_skip_profile
|
|
|
|
|
|
class TestSimulatorApiContractSample(unittest.TestCase):
|
|
"""演示:仅当 ``OPENCLAW_TEST_TARGET=simulator_api`` 时不跳过。"""
|
|
|
|
def test_skip_unless_simulator_api_target(self) -> None:
|
|
skip, reason = should_skip_profile("simulator_api")
|
|
if skip:
|
|
raise unittest.SkipTest(reason)
|
|
# 真实技能中:在此使用 urllib 访问 localhost 仿真,或通过 adapter factory 注入 stub。
|
|
# 禁止默认连接生产 ERP/TMS。
|
|
self.assertTrue(True)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|