mirror of
https://github.com/corazoncp/zoom-sched-poc.git
synced 2026-12-01 04:50:31 +00:00
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)
This commit is contained in:
1 parent
091b9a031a
commit
ed6e0d277c
1 file changed
+11
-7
+11
-7
@@ -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"
|
||||
Reference in new issue
Block a user