add initial test cases for status page functionality
This commit is contained in:
23
tests/test_statuspage.py
Normal file
23
tests/test_statuspage.py
Normal file
@@ -0,0 +1,23 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user