This repository has been archived on 2026-10-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
karldns.de/tests/test_web_sections.py
T

31 lines
1.2 KiB
Python

from karldns.web.html_utils import SafeHtml
from karldns.web.sections.public_home import (
_manual_updates_section,
_public_home_hero,
_setup_flow_section,
)
def test_public_home_sections_render_independently() -> None:
hero = _public_home_hero(
suffix="ddns.example.net",
demo_update_url="https://karldns.example/api/v1/router/update/<secret>?myip=<ipaddr>",
)
setup = _setup_flow_section(
create_demo="curl -sS 'https://karldns.example/api/v1/router/update/<secret>?myip=203.0.113.10'",
create_demo_command="curl -sS 'https://karldns.example/api/v1/router/update/<secret>?myip=203.0.113.10'",
)
manual = _manual_updates_section(
manual_demo="# explicit IPv4\ncurl -sS 'https://karldns.example/api/v1/router/update/<secret>?myip=203.0.113.10'",
)
assert isinstance(hero, SafeHtml)
assert 'data-ui="hero-command"' in hero
assert "ddns.example.net" in hero
assert isinstance(setup, SafeHtml)
assert "KarlDNS setup flow" in setup
assert "Copy update example" in setup
assert isinstance(manual, SafeHtml)
assert 'id="manual-updates"' in manual
assert "Copy manual update examples" in manual