lab4: s3 attachments, private bucket, healthchecks, tests and report

This commit is contained in:
2026-11-03 00:35:32 +03:00
parent ec540a1a72
commit dfadf3eb7c
61 changed files with 2329 additions and 133 deletions
+3 -3
View File
@@ -13,8 +13,8 @@ import urllib.request
import uuid
ROOT = Path(__file__).resolve().parents[1]
LAB = json.loads((ROOT / 'lab.json').read_text())['number']
SPEC = json.loads((ROOT / 'contracts/openapi.json').read_text())
LAB = json.loads((ROOT / 'lab.json').read_text(encoding='utf-8'))['number']
SPEC = json.loads((ROOT / 'contracts/openapi.json').read_text(encoding='utf-8'))
class Failure(AssertionError):
pass
@@ -102,7 +102,7 @@ class Client:
self.base = (base_url or os.environ.get('BASE_URL') or ('https://localhost:8443' if LAB==7 else 'http://localhost:8080')).rstrip('/')
check(self.base.startswith(('http://','https://')), 'BASE_URL must be HTTP(S)')
check(LAB != 7 or self.base.startswith('https://'), 'lab7 requires HTTPS')
self.timeout = timeout
self.timeout = max(timeout, 5)
context = ssl.create_default_context(cafile=ca_file or os.environ.get('CA_FILE') or None)
self.opener = urllib.request.build_opener(NoRedirect(), urllib.request.HTTPSHandler(context=context))