Skip to content

Commit 70d0ee2

Browse files
committed
tests: test inspect with rekor2 annotation
1 parent b8846df commit 70d0ee2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/test_cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
publish_attestation_identity = "https://github.com/trailofbits/pypi-attestations/.github/workflows/release.yml@refs/tags/v0.0.19"
3737
publish_attestation_path = _ASSETS / "pypi_attestations-0.0.19.tar.gz.publish.attestation"
3838
slsa_attestation_path = _ASSETS / "pypi_attestations-0.0.19.tar.gz.slsa.attestation"
39+
rekor2_attestation_path = (
40+
_ASSETS / "pypi_attestations-0.0.19.tar.gz.publish.attestation.with_rekor2_timestamp"
41+
)
42+
3943

4044
pypi_wheel_url = "https://files.pythonhosted.org/packages/fb/f2/3e026065773b84c5b2345e2548a08b10105d324b9b95c72643f57a25fcbb/pypi_attestations-0.0.19-py3-none-any.whl"
4145
pypi_sdist_url = "https://files.pythonhosted.org/packages/c5/4d/a114bdd186903426bd9c1e9c3700761ec5eaac260fa3dfdef14bf84b751b/pypi_attestations-0.0.19.tar.gz"
@@ -229,6 +233,11 @@ def test_inspect_command(caplog: pytest.LogCaptureFixture) -> None:
229233
run_main_with_command(["inspect", "--dump-bytes", publish_attestation_path.as_posix()])
230234
assert "Signature:" in caplog.text
231235

236+
# Happy path with annotation that contains rekor2 entry and a timestamp
237+
run_main_with_command(["inspect", rekor2_attestation_path.as_posix()])
238+
assert "Entry type: dsse 0.0.2" in caplog.text
239+
assert "Timestamps (1):" in caplog.text
240+
232241
# Failure paths
233242
caplog.clear()
234243

0 commit comments

Comments
 (0)