|
|
|
|
@ -180,6 +180,34 @@ def test_system_family_metadata_recognizes_debian_centos_and_ubuntu() -> None:
|
|
|
|
|
assert "/^[0-9]+(?:\\.[0-9]+)?$/" in system_code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_template_import_form_accepts_every_supported_official_host() -> None:
|
|
|
|
|
script = (STATIC / "app.js").read_text(encoding="utf-8")
|
|
|
|
|
submit_code = script.split(
|
|
|
|
|
'byId("template-import-form").addEventListener("submit"', 1
|
|
|
|
|
)[1].split('byId("rescue-template-form")', 1)[0]
|
|
|
|
|
for hostname in (
|
|
|
|
|
"repo.almalinux.org",
|
|
|
|
|
"cloud.debian.org",
|
|
|
|
|
"cloud-images.ubuntu.com",
|
|
|
|
|
"cloud.centos.org",
|
|
|
|
|
):
|
|
|
|
|
assert f'"{hostname}"' in submit_code
|
|
|
|
|
assert 'url.protocol !== "https:"' in submit_code
|
|
|
|
|
assert 'url.port !== "443"' in submit_code
|
|
|
|
|
assert "url.username" in submit_code and "url.password" in submit_code
|
|
|
|
|
assert "url.search" in submit_code and "url.hash" in submit_code
|
|
|
|
|
assert "/almalinux\\/(9|10)" not in submit_code
|
|
|
|
|
|
|
|
|
|
page = (STATIC / "index.html").read_text(encoding="utf-8")
|
|
|
|
|
for label in (
|
|
|
|
|
"AlmaLinux 8/9/10",
|
|
|
|
|
"Debian 11/12/13",
|
|
|
|
|
"CentOS Stream 9/10",
|
|
|
|
|
"Ubuntu 20.04/22.04/24.04/25.04/25.10/26.04",
|
|
|
|
|
):
|
|
|
|
|
assert label in page
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_version_cards_show_only_centered_template_name() -> None:
|
|
|
|
|
script = (STATIC / "app.js").read_text(encoding="utf-8")
|
|
|
|
|
catalog_code = script.split("function renderTemplateCatalog(inputId) {", 1)[1].split(
|
|
|
|
|
|