From ed6e0d277c667a332373544456ac556823154842 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Sat, 21 Nov 2026 18:56:26 -0500 Subject: [PATCH] test(r32/CR-01,CR-02): parametrize edge start_time formats and assert via GET seam - Parametrize malformed_iso and naive_iso start_time cases into single-behavior test_check_slot_availability_handles_edge_start_time_format (resolves r32/CR-01) - Assert payment_processing status via GET /api/appointments/{sid} instead of internal db.get_appointment_by_lookup (resolves r32/CR-02) - Verified with .venv/bin/pytest -v (84 passed) --- tests/test_app.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/test_app.py b/tests/test_app.py index a573101..87fef06 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -449,7 +449,12 @@ def test_check_slot_availability_handles_null_meetings(client, monkeypatch): assert resp.status_code == 201 -def test_check_slot_availability_handles_naive_and_malformed_start_times(client, monkeypatch): +@pytest.mark.parametrize( + "raw_start", + ["not-an-iso-date", "2026-11-24T10:00:00"], + ids=["malformed_iso", "naive_iso"], +) +def test_check_slot_availability_handles_edge_start_time_format(client, monkeypatch, raw_start): test_client, _ = client monkeypatch.setattr( zoom.requests, @@ -463,8 +468,7 @@ def test_check_slot_availability_handles_naive_and_malformed_start_times(client, 200, { "meetings": [ - {"topic": "Malformed", "start_time": "not-an-iso-date", "duration": 60}, - {"topic": "Naive", "start_time": "2026-11-24T10:00:00", "duration": 60}, + {"topic": "Edge Meeting", "start_time": raw_start, "duration": 60}, ] }, ), @@ -1130,7 +1134,7 @@ def test_get_appointment_omits_zoom_start_url_while_pay_returns_it(client, monke def test_delete_rejects_with_409_when_row_claimed_after_lookup_snapshot(client, monkeypatch): from app import db - test_client, db_file = client + test_client, _ = client _mock_zoom_happy_path(monkeypatch) c_resp = test_client.post( @@ -1161,6 +1165,6 @@ def test_delete_rejects_with_409_when_row_claimed_after_lookup_snapshot(client, assert d_resp.status_code == 409 monkeypatch.undo() - persisted = real_lookup(sid, db_path=db_file) - assert persisted is not None - assert persisted["status"] == "payment_processing" + g_resp = test_client.get(f"/api/appointments/{sid}") + assert g_resp.status_code == 200 + assert g_resp.get_json()["status"] == "payment_processing"