From 97c538cf1818b01263a0b099580ef0be13eb5d73 Mon Sep 17 00:00:00 2001 From: Jaixii Date: Sun, 26 Jul 2026 18:18:50 -0400 Subject: [PATCH] test(licensing): make the outage-is-not-a-cancellation test actually test that The test raised CloudSessionError(..., status=503, transient=True), but that class takes only status -- transient belongs to CloudFeatureError. So the construction raised TypeError, the caller's broad except Exception swallowed it, and getattr(exc, "status", None) was None rather than 503. The assertion therefore passed while never exercising a transport failure at all, and could not have caught the regression it exists to prevent: loosening the 402 gate so any error clears a paying customer's access. Verified by mutation -- with the gate changed to any-truthy-status the test now fails with "an outage revoked a paying customer"; before this change it passed even with that mutation. Co-Authored-By: Claude Opus 5 (1M context) --- tests/test_hosted_plan_resolution.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_hosted_plan_resolution.py b/tests/test_hosted_plan_resolution.py index b3812c1..a867f36 100644 --- a/tests/test_hosted_plan_resolution.py +++ b/tests/test_hosted_plan_resolution.py @@ -941,8 +941,13 @@ def test_a_transport_failure_is_not_mistaken_for_a_billing_denial(monkeypatch) - assert _settled_license(monkeypatch)["cloud_access_active"] is True def _offline(*_args, **_kwargs): + # ``CloudSessionError`` takes only ``status``; ``transient`` belongs to + # ``CloudFeatureError``. Passing it here raised TypeError instead, which the + # caller's broad ``except Exception`` swallowed with no ``status`` attribute -- so + # this test used to pass by never exercising a 503 at all, and would not have + # caught a regression that let a genuine outage clear a paying customer's access. raise cloud_session.CloudSessionError( - "Engraphis Cloud is temporarily unreachable.", status=503, transient=True + "Engraphis Cloud is temporarily unreachable.", status=503 ) monkeypatch.setattr(cloud_session, "access_for_workspace", _offline)