fix(auth): a cancel at Google lands where the browser is; the probe says why it refused

A refused session keeps its cookie, so the cancel branch, keyed on the cookie's account, sent a
signed-out browser to the in-app toast the login page never shows: it now asks whether the
session holds. The probe's log line named every refusal 'its account no longer holds'; it now
carries the reason. The pruning docstring says again that a renewal may land a request's time
after the revoke, and the test pins the day of margin. The test clock clamps in the zone asked for.
This commit is contained in:
2026-11-14 20:07:13 +01:00
parent 7dd50db9b7
commit 7a1487f554
6 changed files with 98 additions and 19 deletions
+23
View File
@@ -49,3 +49,26 @@ def test_a_test_reads_the_clock_the_app_stamps_with(monkeypatch):
monkeypatch.setattr(conftest._NeverBack, "last", None)
stamped = diagnostics.datetime.now(timezone.utc)
assert datetime.now(timezone.utc) >= stamped
def test_a_clamped_reading_is_in_the_zone_asked_for(monkeypatch):
# The Pacific quota day read through a clamp came back in UTC: its date was the next day's.
from zoneinfo import ZoneInfo
import conftest
pacific = ZoneInfo("America/Los_Angeles")
utc_reading = datetime(2099, 1, 2, 3, 0, 0, tzinfo=timezone.utc) # 1 January 19:00 in Pacific
stepped_back = datetime(2099, 1, 1, 18, 59, 59, tzinfo=pacific) # a second earlier
class Stepping(datetime):
@classmethod
def now(cls, tz=None):
return utc_reading if tz is timezone.utc else stepped_back
monkeypatch.setattr(conftest._NeverBack, "clock", Stepping)
monkeypatch.setattr(conftest._NeverBack, "last", None)
conftest._NeverBack.now(timezone.utc)
clamped = conftest._NeverBack.now(pacific)
assert clamped.tzinfo is pacific
assert clamped.date().isoformat() == "2099-01-01"