mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 18:17:13 +02:00
Skip SHA1 verification for non SF packages
This commit is contained in:
@ -52,19 +52,25 @@ def validate_package(url, sfpkglist):
|
|||||||
|
|
||||||
def test_package(package_data, sfpkglist):
|
def test_package(package_data, sfpkglist):
|
||||||
assert package_data['url'].endswith("%d.tar.gz" % package_data['version'])
|
assert package_data['url'].endswith("%d.tar.gz" % package_data['version'])
|
||||||
|
sf_package = "sourceforge.net" in package_data['url']
|
||||||
|
|
||||||
# check content type and that file exists
|
# check content type and that file exists
|
||||||
try:
|
try:
|
||||||
r = requests.head(package_data['url'], allow_redirects=True)
|
r = requests.head(package_data['url'], allow_redirects=True)
|
||||||
if 500 <= r.status_code <= 599:
|
if 500 <= r.status_code <= 599:
|
||||||
raise requests.exceptions.ConnectionError()
|
raise requests.exceptions.ConnectionError()
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError as e:
|
||||||
return pytest.skip("SF is off-line")
|
if sf_package:
|
||||||
|
return pytest.skip("SF is off-line")
|
||||||
|
raise Exception(e)
|
||||||
|
|
||||||
validate_response(r)
|
validate_response(r)
|
||||||
assert r.headers['Content-Type'] in ("application/x-gzip",
|
assert r.headers['Content-Type'] in ("application/x-gzip",
|
||||||
"application/octet-stream")
|
"application/octet-stream")
|
||||||
|
|
||||||
|
if not sf_package:
|
||||||
|
return
|
||||||
|
|
||||||
# check sha1 sum
|
# check sha1 sum
|
||||||
if sfpkglist is None:
|
if sfpkglist is None:
|
||||||
return pytest.skip("SF is off-line")
|
return pytest.skip("SF is off-line")
|
||||||
|
Reference in New Issue
Block a user