Files
check_pa/tests/test_statuspage.py

23 lines
631 B
Python

from datetime import datetime
from main import is_status_page, parse_status_page, normalize_status_text
SAMPLE_HTML = "sample_html/status_in_produktion.html"
def test_is_status_page_positive():
with open(SAMPLE_HTML, encoding="utf-8") as fh:
html = fh.read()
assert is_status_page(html) is True
def test_parse_status_page_positive():
with open(SAMPLE_HTML, encoding="utf-8") as fh:
html = fh.read()
status_raw, timestamp = parse_status_page(html)
status = normalize_status_text(status_raw)
assert status == "noch in Produktion"
assert timestamp == datetime(2026, 2, 2, 16, 0, 0)