File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/spdx_tools/spdx/validation Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ def validate_url(url: str) -> List[str]:
2828
2929
3030def validate_download_location (location : str ) -> List [str ]:
31- if not re .match (download_location_pattern , location ):
32- return [f"must be a valid download location according to the specification, but is: { location } " ]
31+ if not ( validate_url ( location ) == [] or re .match (download_location_pattern , location ) ):
32+ return [f"must be a valid URL or download location according to the specification, but is: { location } " ]
3333
3434 return []
3535
Original file line number Diff line number Diff line change 1818)
1919def test_valid_url (input_value ):
2020 assert validate_url (input_value ) == []
21+ # URLs are also valid download locations:
22+ assert validate_download_location (input_value ) == []
2123
2224
2325# TODO: more negative examples: https://github.com/spdx/tools-python/issues/377
@@ -92,7 +94,7 @@ def test_valid_package_download_location(input_value):
9294)
9395def test_invalid_package_download_location (input_value ):
9496 assert validate_download_location (input_value ) == [
95- f"must be a valid download location according to the specification, but is: { input_value } "
97+ f"must be a valid URL or download location according to the specification, but is: { input_value } "
9698 ]
9799
98100
You can’t perform that action at this time.
0 commit comments