fix(场景测试): 完善文件转发校验
从原始 multipart 中解析文件并校验 SHA-256,报告补充上游路径和逐项断言结果。 加强状态、响应头、期望事件和 SSE 数据校验,补充路径和文件转发回归测试。
This commit is contained in:
1 parent
b583d89b39
commit
e880d5cd62
3 files changed
+128
-14
No files matched your search
@@ -91,6 +91,8 @@ async def test_runner_executes_sse_post_and_file_with_real_matching(tmp_path, ca
|
||||
assert reports[0]["plugins"] == ["marker"]
|
||||
assert reports[1]["plugins"] == []
|
||||
assert reports[2]["plugins"] == []
|
||||
assert reports[2]["upstream_path"] == "/upload?source=test"
|
||||
assert reports[2]["assertions"]["file_forwarded"] is True
|
||||
assert len(capsys.readouterr().out.splitlines()) == 3
|
||||
|
||||
|
||||
@@ -100,6 +102,24 @@ def test_scenario_schema_and_file_path_safety(tmp_path):
|
||||
with pytest.raises(ScenarioError, match="must not be empty"):
|
||||
load_scenarios(scenario)
|
||||
|
||||
scenario.write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"scenarios": [
|
||||
{
|
||||
"id": "fragment",
|
||||
"kind": "post",
|
||||
"path": "/upload#fragment",
|
||||
"response": {"body": {}},
|
||||
}
|
||||
]
|
||||
}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
with pytest.raises(ScenarioError, match="fragment"):
|
||||
load_scenarios(scenario)
|
||||
|
||||
with pytest.raises(ScenarioError, match="below the scenario directory"):
|
||||
build_request(
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user