Commit d0d57988 authored by Maximilian Dolling's avatar Maximilian Dolling

closed request http socket

parent ea28e338
......@@ -88,7 +88,8 @@ def get_python_libraries_license(libraries_dict):
else:
version = '/{}'.format(libraries_dict[lib][0][2:])
url = 'https://pypi.org/pypi/{}{}/json'.format(lib, version)
response = requests.get(url=url)
response = requests.get(url=url,
headers={'Connection': 'close'})
if response.status_code != 200:
license_dict['unknowns'][lib] = 'PyPi API error: {} returned by {}'.format(response.status_code, url)
......
......@@ -62,9 +62,14 @@ class TestLicenseRequesterFunctions(unittest.TestCase):
'http://wxpython.org/wxPython_Phoenix-3.0.3.dev18.whl': 'unknown location',
'scipy': 'unknown version'}}
print(license_requester.get_python_libraries_license(test_data))
assert license_requester.get_python_libraries_license(test_data) == result_data
class TestLanguageParserFunctions(unittest.TestCase):
def test_python(self):
assert 1 == 1
if __name__ == '__main__':
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment