feat(data-process): 支持单项生成五十条数据
This commit is contained in:
@@ -945,6 +945,47 @@ def test_config_validation_and_stop_state(tmp_path: Path) -> None:
|
||||
assert stopped.json()["data"]["status"] == "stopped"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("config_key", ["qa_pairs_per_row", "qa_pairs_per_chunk"])
|
||||
@pytest.mark.parametrize("count", [1, 50])
|
||||
def test_qa_pair_config_accepts_supported_boundaries(
|
||||
tmp_path: Path,
|
||||
config_key: str,
|
||||
count: int,
|
||||
) -> None:
|
||||
client, _, _ = make_client(tmp_path)
|
||||
response = client.post(
|
||||
"/modelTF/data-process",
|
||||
json={
|
||||
"name": "问答数量边界",
|
||||
"process_type": "unstructured",
|
||||
"config": {config_key: count},
|
||||
},
|
||||
)
|
||||
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
@pytest.mark.parametrize("config_key", ["qa_pairs_per_row", "qa_pairs_per_chunk"])
|
||||
@pytest.mark.parametrize("count", [0, 51])
|
||||
def test_qa_pair_config_rejects_out_of_range_boundaries(
|
||||
tmp_path: Path,
|
||||
config_key: str,
|
||||
count: int,
|
||||
) -> None:
|
||||
client, _, _ = make_client(tmp_path)
|
||||
response = client.post(
|
||||
"/modelTF/data-process",
|
||||
json={
|
||||
"name": "问答数量越界",
|
||||
"process_type": "unstructured",
|
||||
"config": {config_key: count},
|
||||
},
|
||||
)
|
||||
|
||||
assert response.status_code == 422
|
||||
assert "[1, 50]" in response.text
|
||||
|
||||
|
||||
def test_upload_batch_is_atomic_and_empty_files_are_rejected(tmp_path: Path) -> None:
|
||||
client, store, storage = make_client(tmp_path)
|
||||
task_id = client.post(
|
||||
|
||||
Reference in New Issue
Block a user