feature: scripts/export_run.py 用来导出运行结果
This commit is contained in:
@@ -2,7 +2,9 @@ from pathlib import Path
|
||||
from runpy import run_path
|
||||
|
||||
|
||||
render_markdown = run_path(Path(__file__).parents[1] / "scripts/export_run.py")["render_markdown"]
|
||||
exports = run_path(Path(__file__).parents[1] / "scripts/export_run.py")
|
||||
matches_result = exports["matches_result"]
|
||||
render_markdown = exports["render_markdown"]
|
||||
|
||||
|
||||
def test_render_markdown_contains_input_output_and_judgement():
|
||||
@@ -24,3 +26,12 @@ def test_render_markdown_contains_input_output_and_judgement():
|
||||
)
|
||||
|
||||
assert all(value in text for value in ["测试输入", "模型输出", "fail", "0.9", "仲裁理由"])
|
||||
|
||||
|
||||
def test_result_filters_default_to_all_and_combine():
|
||||
passed = {"execution_status": "completed", "verdict": "pass"}
|
||||
|
||||
assert matches_result(passed, None, None)
|
||||
assert matches_result(passed, "completed", "pass")
|
||||
assert not matches_result(passed, "error", None)
|
||||
assert not matches_result(passed, None, "fail")
|
||||
|
||||
Reference in New Issue
Block a user