Restructuration + init test system

This commit is contained in:
2022-09-11 11:52:41 +02:00
parent a3dd6698fc
commit 6b26b89c69
22 changed files with 60 additions and 82 deletions

View File

@@ -0,0 +1,17 @@
from http.client import HTTPException
import re
from urllib import request as http
def fetch_version(headers: str, url: str) -> str:
"""
"""
request = http.Request(url=url, headers=headers, method='GET')
response = http.urlopen(request)
if response.getcode() != 200:
raise HTTPException("Bad response returned by server")
return response.read().decode('utf-8')