idea128-investlearn-studio-.../tests/test_simulation_and_ledger.py

16 lines
548 B
Python

from idea128_investlearn_studio_verifiable import simulation, sync
def test_simulation_deterministic():
a = simulation.simulate_price_series(seed=42, n_steps=5, start_price=100.0)
b = simulation.simulate_price_series(seed=42, n_steps=5, start_price=100.0)
assert a == b
assert len(a) == 5
def test_ledger_append_and_verify():
ledger = sync.Ledger()
ledger.append({"event": "module_completed", "module": "risk"})
ledger.append({"event": "quiz_passed", "module": "portfolio", "score": 0.8})
assert ledger.verify()