Update license test to work with http(s) urls in requirements files

This commit is contained in:
Shane McDonald
2021-09-24 10:16:11 -04:00
parent dbb1a0c733
commit c4d8485c81

View File

@@ -57,6 +57,9 @@ def test_python_and_js_licenses():
if version.startswith('=='): if version.startswith('=='):
version = version[2:] version = version[2:]
if reqt.link: if reqt.link:
if str(reqt.link).startswith(('http://', 'https://')):
(name, version) = str(reqt.req).split('==', 1)
else:
(name, version) = reqt.link.filename.split('@', 1) (name, version) = reqt.link.filename.split('@', 1)
if name.endswith('.git'): if name.endswith('.git'):
name = name[:-4] name = name[:-4]