test(regulatory-info-package): 覆盖材料包主链路
This commit is contained in:
22
tests/test_regulatory_info_package_zip.py
Normal file
22
tests/test_regulatory_info_package_zip.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import zipfile
|
||||
|
||||
from review_agent.regulatory_info_package.schemas import GeneratedFileResult
|
||||
from review_agent.regulatory_info_package.services.zip_export import create_zip_package
|
||||
|
||||
|
||||
def test_create_zip_package_includes_only_success_files(tmp_path):
|
||||
success = tmp_path / "ok.docx"
|
||||
failed = tmp_path / "bad.docx"
|
||||
success.write_bytes(b"ok")
|
||||
failed.write_bytes(b"bad")
|
||||
|
||||
zip_path = create_zip_package(
|
||||
tmp_path,
|
||||
[
|
||||
GeneratedFileResult("ok", "ok.docx", "docx", "docx", "success", path=str(success)),
|
||||
GeneratedFileResult("bad", "bad.docx", "docx", "docx", "failed", path=str(failed)),
|
||||
],
|
||||
)
|
||||
|
||||
with zipfile.ZipFile(zip_path) as archive:
|
||||
assert archive.namelist() == ["ok.docx"]
|
||||
Reference in New Issue
Block a user