@@ -26,7 +26,7 @@ def test_valid_creation_info():
2626 [get_actor (), get_actor ()], datetime (2022 , 1 , 1 ), "creator_comment" ,
2727 "CC0-1.0" , [get_external_document_ref (), get_external_document_ref ()], Version (6 , 3 ),
2828 "doc_comment" )
29- validation_messages : List [ValidationMessage ] = validate_creation_info (creation_info )
29+ validation_messages : List [ValidationMessage ] = validate_creation_info (creation_info , "SPDX-2.3" )
3030
3131 assert validation_messages == []
3232
@@ -35,6 +35,8 @@ def test_valid_creation_info():
3535 ("creation_info_input, spdx_id, expected_message" ,
3636 [(get_creation_info (spdx_version = "version-2.3" ), "SPDXRef-DOCUMENT" ,
3737 'spdx_version must be of the form "SPDX-[major].[minor]" but is: version-2.3' ),
38+ (get_creation_info (spdx_version = "SPDX-2.2" ), "SPDXRef-DOCUMENT" ,
39+ f"provided SPDX version SPDX-2.3 does not match the document's SPDX version SPDX-2.2" ),
3840 (get_creation_info (spdx_id = "SPDXRef-doc" ), "SPDXRef-doc" ,
3941 'spdx_id must be "SPDXRef-DOCUMENT", but is: SPDXRef-doc' ),
4042 (get_creation_info (data_license = "MIT" ), "SPDXRef-DOCUMENT" ,
@@ -43,7 +45,7 @@ def test_valid_creation_info():
4345 "document_namespace must be a valid URI specified in RFC-3986, but is: some_namespace" ),
4446 ])
4547def test_invalid_creation_info (creation_info_input , expected_message , spdx_id ):
46- validation_messages : List [ValidationMessage ] = validate_creation_info (creation_info_input )
48+ validation_messages : List [ValidationMessage ] = validate_creation_info (creation_info_input , "SPDX-2.3" )
4749
4850 expected = ValidationMessage (expected_message , ValidationContext (spdx_id , None , SpdxElementType .DOCUMENT ))
4951
0 commit comments