Skip to content

Commit 361718e

Browse files
committed
LCORE-1569,LCORE-1570: extend dump-configuration fixtures with new fields
The five tests in test_dump_configuration.py compare Configuration.model_dump() output against hard-coded expected dictionaries. Adding `context_windows` to InferenceConfiguration (LCORE-1569) and `compaction` to the root Configuration (LCORE-1570) shifts the dump shape, so the expected fixtures need matching entries. Update every dump-test expected dict to include: * `inference.context_windows: {}` — the empty-by-default per-model context-window registry. * `compaction: { enabled: False, threshold_ratio: 0.7, token_floor: 4096, buffer_turns: 4, buffer_max_ratio: 0.3 }` — the defaults baked into the root Configuration's default_factory. Fixture-only change. No production-code change. Caught by running the full unit-test suite (`uv run pytest tests/unit/`) — the per-file test runs I did originally only covered the new tests, which missed this snapshot-shape coupling.
1 parent 0ad8a96 commit 361718e

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

tests/unit/models/config/test_dump_configuration.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def test_dump_configuration(tmp_path: Path) -> None:
168168
"inference": {
169169
"default_provider": "default_provider",
170170
"default_model": "default_model",
171+
"context_windows": {},
171172
},
172173
"database": {
173174
"sqlite": None,
@@ -190,6 +191,13 @@ def test_dump_configuration(tmp_path: Path) -> None:
190191
"sqlite": None,
191192
"type": None,
192193
},
194+
"compaction": {
195+
"enabled": False,
196+
"threshold_ratio": 0.7,
197+
"token_floor": 4096,
198+
"buffer_turns": 4,
199+
"buffer_max_ratio": 0.3,
200+
},
193201
"byok_rag": [],
194202
"quota_handlers": {
195203
"sqlite": None,
@@ -511,6 +519,7 @@ def test_dump_configuration_with_quota_limiters(tmp_path: Path) -> None:
511519
"inference": {
512520
"default_provider": "default_provider",
513521
"default_model": "default_model",
522+
"context_windows": {},
514523
},
515524
"database": {
516525
"sqlite": None,
@@ -533,6 +542,13 @@ def test_dump_configuration_with_quota_limiters(tmp_path: Path) -> None:
533542
"sqlite": None,
534543
"type": None,
535544
},
545+
"compaction": {
546+
"enabled": False,
547+
"threshold_ratio": 0.7,
548+
"token_floor": 4096,
549+
"buffer_turns": 4,
550+
"buffer_max_ratio": 0.3,
551+
},
536552
"byok_rag": [],
537553
"quota_handlers": {
538554
"sqlite": None,
@@ -746,6 +762,7 @@ def test_dump_configuration_with_quota_limiters_different_values(
746762
"inference": {
747763
"default_provider": "default_provider",
748764
"default_model": "default_model",
765+
"context_windows": {},
749766
},
750767
"database": {
751768
"sqlite": None,
@@ -768,6 +785,13 @@ def test_dump_configuration_with_quota_limiters_different_values(
768785
"sqlite": None,
769786
"type": None,
770787
},
788+
"compaction": {
789+
"enabled": False,
790+
"threshold_ratio": 0.7,
791+
"token_floor": 4096,
792+
"buffer_turns": 4,
793+
"buffer_max_ratio": 0.3,
794+
},
771795
"byok_rag": [],
772796
"quota_handlers": {
773797
"sqlite": None,
@@ -961,6 +985,7 @@ def test_dump_configuration_byok(tmp_path: Path) -> None:
961985
"inference": {
962986
"default_provider": "default_provider",
963987
"default_model": "default_model",
988+
"context_windows": {},
964989
},
965990
"database": {
966991
"sqlite": None,
@@ -983,6 +1008,13 @@ def test_dump_configuration_byok(tmp_path: Path) -> None:
9831008
"sqlite": None,
9841009
"type": None,
9851010
},
1011+
"compaction": {
1012+
"enabled": False,
1013+
"threshold_ratio": 0.7,
1014+
"token_floor": 4096,
1015+
"buffer_turns": 4,
1016+
"buffer_max_ratio": 0.3,
1017+
},
9861018
"byok_rag": [
9871019
{
9881020
"db_path": "tests/configuration/rag.txt",
@@ -1166,6 +1198,7 @@ def test_dump_configuration_pg_namespace(tmp_path: Path) -> None:
11661198
"inference": {
11671199
"default_provider": "default_provider",
11681200
"default_model": "default_model",
1201+
"context_windows": {},
11691202
},
11701203
"database": {
11711204
"sqlite": None,
@@ -1188,6 +1221,13 @@ def test_dump_configuration_pg_namespace(tmp_path: Path) -> None:
11881221
"sqlite": None,
11891222
"type": None,
11901223
},
1224+
"compaction": {
1225+
"enabled": False,
1226+
"threshold_ratio": 0.7,
1227+
"token_floor": 4096,
1228+
"buffer_turns": 4,
1229+
"buffer_max_ratio": 0.3,
1230+
},
11911231
"byok_rag": [],
11921232
"quota_handlers": {
11931233
"sqlite": None,

0 commit comments

Comments
 (0)