chore: auto release commit (2026-07-03 12:09:55)
All checks were successful
技能自动化发布 / release (push) Successful in 5s
All checks were successful
技能自动化发布 / release (push) Successful in 5s
This commit is contained in:
@@ -25,7 +25,7 @@ class TestCliSmoke(unittest.TestCase):
|
||||
rc = main([])
|
||||
self.assertEqual(rc, 1)
|
||||
out = buf.getvalue()
|
||||
self.assertIn("通用业务技能模板", out)
|
||||
self.assertIn("Amazon 结算报表", out)
|
||||
self.assertIn("health", out)
|
||||
|
||||
def test_health_zero(self) -> None:
|
||||
@@ -72,19 +72,32 @@ class TestCliSmoke(unittest.TestCase):
|
||||
self.assertNotEqual(rc, 0)
|
||||
self.assertIn("数字", buf.getvalue())
|
||||
|
||||
def test_run_placeholder_returns_nonzero_without_network(self) -> None:
|
||||
"""占位 run:RpaVideoSession 示范 + 模板提示;OPENCLAW_RECORD_VIDEO=0 时不启 ffmpeg。"""
|
||||
def test_run_mock_returns_ok_json(self) -> None:
|
||||
"""mock 档位 run:返回 ok JSON,退出码 0。"""
|
||||
old_auth = os.environ.pop("JIANGCHANG_AUTH_BASE_URL", None)
|
||||
old_record = os.environ.get("OPENCLAW_RECORD_VIDEO")
|
||||
old_target = os.environ.get("OPENCLAW_TEST_TARGET")
|
||||
os.environ["OPENCLAW_RECORD_VIDEO"] = "0"
|
||||
os.environ["OPENCLAW_TEST_TARGET"] = "mock"
|
||||
try:
|
||||
with IsolatedDataRoot(user_id="_cli_run"):
|
||||
config.reset_cache()
|
||||
buf = io.StringIO()
|
||||
with redirect_stdout(buf), redirect_stderr(io.StringIO()):
|
||||
rc = main(["run"])
|
||||
self.assertNotEqual(rc, 0)
|
||||
self.assertIn("模板", buf.getvalue())
|
||||
rc = main(
|
||||
[
|
||||
"run",
|
||||
"--date-from",
|
||||
"2025-12-01",
|
||||
"--date-to",
|
||||
"2025-12-31",
|
||||
]
|
||||
)
|
||||
self.assertEqual(rc, 0)
|
||||
payload = json.loads(buf.getvalue().strip().splitlines()[-1])
|
||||
self.assertTrue(payload.get("ok"))
|
||||
self.assertIn("job_id", payload)
|
||||
self.assertIn("file_path", payload)
|
||||
finally:
|
||||
if old_auth is not None:
|
||||
os.environ["JIANGCHANG_AUTH_BASE_URL"] = old_auth
|
||||
@@ -92,6 +105,11 @@ class TestCliSmoke(unittest.TestCase):
|
||||
os.environ.pop("OPENCLAW_RECORD_VIDEO", None)
|
||||
else:
|
||||
os.environ["OPENCLAW_RECORD_VIDEO"] = old_record
|
||||
if old_target is None:
|
||||
os.environ.pop("OPENCLAW_TEST_TARGET", None)
|
||||
else:
|
||||
os.environ["OPENCLAW_TEST_TARGET"] = old_target
|
||||
config.reset_cache()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user