1from market_agents.experiments.config import RunConfig234def test_leaf_dict_overrides_replace_and_sections_merge():5 cfg = RunConfig()6 t = cfg.with_overrides(**{"population.llm.provider_mix": {"openai": 1.0}, "population.llm_share": 0.25, "exchange.halt_threshold": 0.05})7 assert t.population.llm.provider_mix == {"openai": 1.0}8 assert t.population.llm_share == 0.25 and t.exchange.halt_threshold == 0.059 assert t.exchange.taker_fee_bps == cfg.exchange.taker_fee_bps # section merge keeps the rest10 t2 = cfg.with_overrides(population={"mix": {"market_maker": 1.0}, "activity": {"market_maker": 0.0}})11 assert t2.population.mix == {"market_maker": 1.0}12