mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-10 20:07:16 +01:00
test: pin credit time in TestRealLedgers so the grace floor can't win after 19:00
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018RHwVPyiiQMPh4M3JQwQku
This commit is contained in:
parent
965b9c4ebb
commit
52fd8217f5
@ -145,8 +145,11 @@ class TestANewlyRegisteredEarner:
|
||||
class TestRealLedgers:
|
||||
def test_signed_credits_on_disk_reach_the_reset(self, tmp_path: Path) -> None:
|
||||
"""No mock between the ledgers and the written hour."""
|
||||
write_ledger(earned_time.LEETCODE, [credit(earned_time.LEETCODE)])
|
||||
write_ledger(earned_time.READING, [credit(earned_time.READING)])
|
||||
# Pinned to local midnight: stamped "now", the grace floor (first
|
||||
# credit + GRACE_MINUTES) beats base+120 whenever this runs after ~19:00.
|
||||
midnight = datetime.now(tz=UTC).astimezone().replace(hour=0, minute=0, second=0)
|
||||
write_ledger(earned_time.LEETCODE, [credit(earned_time.LEETCODE, midnight)])
|
||||
write_ledger(earned_time.READING, [credit(earned_time.READING, midnight)])
|
||||
state = tmp_path / "state.json"
|
||||
mixin = _mixin()
|
||||
with signing_key(tmp_path):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user