File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10+ ### Changed
11+
12+ - The ` inspect ` subcommand now ignores inputs that don't match ` *.attestation ` ,
13+ rather than failing on them
14+ ([ #93 ] ( https://github.com/trailofbits/pypi-attestations/pull/93 ) )
15+
1016### Added
1117
1218- The CLI subcommand ` verify attestation ` now supports ` .slsa.attestation `
@@ -22,7 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2228
2329### Changed
2430
25- - The CLI entrypoint is now ` pypi-attestations `
31+ - The CLI entrypoint is now ` pypi-attestations `
2632 ([ #82 ] ( https://github.com/trailofbits/pypi-attestations/pull/82 ) )
2733- The CLI ` verify ` subcommand has been changed to ` verify attestation ` ,
2834 as in ` pypi-attestations verify attestation --identity ... `
Original file line number Diff line number Diff line change @@ -390,7 +390,7 @@ def _inspect(args: argparse.Namespace) -> None:
390390
391391 Warning: The information displayed from the attestations are not verified.
392392 """
393- attestation_files = [f for f in args .files if f .suffix == ' .attestation' ]
393+ attestation_files = [f for f in args .files if f .suffix == " .attestation" ]
394394 _validate_files (attestation_files , should_exist = True )
395395 for file_path in attestation_files :
396396 try :
Original file line number Diff line number Diff line change @@ -199,21 +199,14 @@ def test_inspect_command(caplog: pytest.LogCaptureFixture) -> None:
199199
200200 # Failure because not an attestation
201201 with tempfile .NamedTemporaryFile (suffix = ".publish.attestation" ) as f :
202- fake_package_name = Path ( f . name . removesuffix ( ".publish. attestation") )
203- fake_package_name . touch ()
202+ f . write ( b"not an attestation" )
203+ f . flush ()
204204
205205 with pytest .raises (SystemExit ):
206- run_main_with_command (["inspect" , fake_package_name . as_posix () ])
206+ run_main_with_command (["inspect" , f . name ])
207207
208208 assert "Invalid attestation" in caplog .text
209209
210- # Failure because file is missing
211- caplog .clear ()
212- with pytest .raises (SystemExit ):
213- run_main_with_command (["inspect" , "not_a_file.txt" ])
214-
215- assert "not_a_file.txt is not a file." in caplog .text
216-
217210
218211def test_verify_attestation_command (caplog : pytest .LogCaptureFixture ) -> None :
219212 # Happy path
You can’t perform that action at this time.
0 commit comments