diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9b38853 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "python.testing.pytestArgs": [ + "tests" + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true +} \ No newline at end of file diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..0d2f867 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,5 @@ +[pytest] +minversion = 7.0 +addopts = -ra +testpaths = tests +python_files = test_*.py \ No newline at end of file diff --git a/sample_html/status_in_produktion.html b/sample_html/status_in_produktion.html new file mode 100644 index 0000000..dc37ea4 --- /dev/null +++ b/sample_html/status_in_produktion.html @@ -0,0 +1,1937 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OLAV 25.11.01-331 - Online Anträge und Vorgänge - Statusabfrage hoheitlicher Dokumente + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Statusabfrage hoheitlicher Dokumente

+ + + + + + + + + + +
Sitzungszeit:00:58:47
+ + + + Berlin + +  |  + + + + + + + + +   + + Beenden + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +

Statusabfrage hoheitlicher Dokumente

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
    +
  • Anfrage
  • +
  • Sie sind hier: Ergebnis
  • +
+
+
+ + + + + +
+ + + + + + + + + + +
+ (*) sind Pflichtfelder +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Statusabfrage Suchergebnis + + + + + + + + + + +
+ + +
+ Das beantragte Dokument hat den Status: + + + + + + + + + + + +
+ + + + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Benachrichtigung über E-Mail + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
+ +
+ + + + + + + + + + + +
+ + + + + + + + +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
+ +
+ + + + + + + + + + + +
+ + +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Bestätigung der Datenschutzhinweise + +
+
+ +
+
+ + + + + + +
+
+ + + + + +
+
+ + + + + + + + + + +
+ + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + +
+ + + +
+ +
+ + + + + + +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/test_statuspage.py b/tests/test_statuspage.py new file mode 100644 index 0000000..ef22df8 --- /dev/null +++ b/tests/test_statuspage.py @@ -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) \ No newline at end of file