File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
src/spdx_tools/spdx/validation Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ def validate_url(url: str) -> List[str]:
28
28
29
29
30
30
def 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 } " ]
33
33
34
34
return []
35
35
Original file line number Diff line number Diff line change 18
18
)
19
19
def test_valid_url (input_value ):
20
20
assert validate_url (input_value ) == []
21
+ # URLs are also valid download locations:
22
+ assert validate_download_location (input_value ) == []
21
23
22
24
23
25
# TODO: more negative examples: https://github.com/spdx/tools-python/issues/377
You can’t perform that action at this time.
0 commit comments