INNER CODE UNIT · Python
fake_run
94fzb/zrlog · shell/release/test_generate_trust_metadata.py:35
def fake_run(command: list[str]) -> str:
if command[0] == "syft":
Path(command[-1].split("=", 1)[1]).write_text(
'{"bomFormat":"CycloneDX"}\n', encoding="utf-8"
)
elif command[0] == "cosign":
Path(command[4]).write_text('{"verificationMaterial":{}}\n', encoding="utf-8")
return ""
with patch.object(MODULE, "run", side_effect=fake_run):
generated = MODULE.generate(
artifact,
source_commit="a" * 40,
source_repository="https://github.com/94fzb/zrlog",
workflow_url="https://github.com/94fzb/zrlog/actions/runs/1",
build_timestamp="2026-07-31T00:00:00+00:00",
)