Files
codex-mmo/evals/adaptive-change/holdout/decomposable-ledger/test_holdout_ledger.py
T

17 lines
509 B
Python
Raw Normal View History

2026-08-24 08:11:59 -07:00
import unittest
from ledger import Ledger
class HoldoutLedgerTests(unittest.TestCase):
def test_rejected_id_remains_globally_available(self):
ledger = Ledger()
with self.assertRaises(ValueError):
ledger.apply("shared", "a", -1)
self.assertEqual(ledger.apply("shared", "b", 3), 3)
def test_successful_id_is_global_across_accounts(self):
ledger = Ledger()
ledger.apply("shared", "a", 3)
self.assertEqual(ledger.apply("shared", "b", 9), 0)