Skip to content

Commit 91c9f2a

Browse files
authored
tests: add unittests for GPKE behaviour (#205)
see Hochfrequenz/fristenkalender-frontend#363
1 parent 126f096 commit 91c9f2a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

unittests/test_generate_fristen_for_type.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,36 @@ def test_ok_get(self, ok_request: func.HttpRequest):
3535
}
3636
assert actual_frist == expected
3737

38+
@pytest.mark.parametrize(
39+
"ok_request,expected_length",
40+
[
41+
pytest.param(
42+
func.HttpRequest(
43+
"GET",
44+
"testhost/GenerateFristenForType",
45+
route_params={"year": "2025", "fristen_type": "GPKE"},
46+
body=bytes(),
47+
),
48+
6,
49+
id="No GPKE 3LWT Fristen after 24h LFW (June 2025)",
50+
),
51+
pytest.param(
52+
func.HttpRequest(
53+
"GET",
54+
"testhost/GenerateFristenForType",
55+
route_params={"year": "2026", "fristen_type": "GPKE"},
56+
body=bytes(),
57+
),
58+
0,
59+
),
60+
],
61+
)
62+
def test_non_empty_get(self, ok_request: func.HttpRequest, expected_length: int):
63+
actual_response = main(ok_request)
64+
assert actual_response.status_code == HTTPStatus.OK
65+
actual = json.loads(actual_response.get_body().decode("utf-8"))
66+
assert len(actual) == expected_length
67+
3868
@pytest.mark.parametrize(
3969
"bad_request",
4070
[

0 commit comments

Comments
 (0)