(tmp_path)
| 3 | |
| 4 | |
| 5 | def test_save_load_roundtrip(tmp_path): |
| 6 | state = LearnedState( |
| 7 | signal_weights=[0.55, 0.45], |
| 8 | calibration_temperature=0.75, |
| 9 | shadow_consecutive_wins=1, |
| 10 | shadow_promoted=False, |
| 11 | embedding_index_size=487, |
| 12 | model_priors={"deepseek": {"alpha": 5, "beta": 2}}, |
| 13 | ) |
| 14 | save_state(state, tmp_path) |
| 15 | loaded = load_state(tmp_path) |
| 16 | assert loaded.signal_weights == [0.55, 0.45] |
| 17 | assert loaded.calibration_temperature == 0.75 |
| 18 | assert loaded.shadow_consecutive_wins == 1 |
| 19 | assert not loaded.shadow_promoted |
| 20 | assert loaded.embedding_index_size == 487 |
| 21 | assert loaded.model_priors["deepseek"]["alpha"] == 5 |
| 22 | |
| 23 | |
| 24 | def test_load_missing_dir_returns_defaults(tmp_path): |
nothing calls this directly
no test coverage detected