mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
Subuwu
This commit is contained in:
@@ -240,6 +240,17 @@ class TestManager:
|
||||
assert params.get("CEModelStopTime") == "3.5"
|
||||
assert params_cache.get_bool("NNFF")
|
||||
|
||||
def test_migrate_starpilot_default_parity_seeds_new_model_stop_time_default(self, tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(manager, "STARPILOT_DEFAULTS_PARITY_MIGRATION_FLAG", tmp_path / "starpilot_defaults_parity_v1")
|
||||
|
||||
params = FileBackedFakeParams(tmp_path / "params")
|
||||
params_cache = FileBackedFakeParams(tmp_path / "cache")
|
||||
|
||||
manager.migrate_starpilot_default_parity(params, params_cache)
|
||||
|
||||
assert params.get("CEModelStopTime") == "7.7"
|
||||
assert params_cache.get("CEModelStopTime") == "7.7"
|
||||
|
||||
def test_migrate_starpilot_default_model(self, tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(manager, "STARPILOT_DEFAULT_MODEL_MIGRATION_FLAG", tmp_path / "starpilot_default_model_rdf_v1")
|
||||
|
||||
@@ -262,17 +273,28 @@ class TestManager:
|
||||
assert manager.STARPILOT_DEFAULT_MODEL_MIGRATION_FLAG.exists()
|
||||
|
||||
def test_migrate_starpilot_ce_model_stop_time(self, tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(manager, "STARPILOT_CE_MODEL_STOP_TIME_MIGRATION_FLAG", tmp_path / "starpilot_ce_model_stop_time_v1")
|
||||
monkeypatch.setattr(manager, "STARPILOT_CE_MODEL_STOP_TIME_MIGRATION_FLAG", tmp_path / "starpilot_ce_model_stop_time_v2")
|
||||
|
||||
params = FileBackedFakeParams(tmp_path / "params", {"CEModelStopTime": 7.0})
|
||||
params = FileBackedFakeParams(tmp_path / "params", {"CEModelStopTime": 9.0})
|
||||
params_cache = FileBackedFakeParams(tmp_path / "cache")
|
||||
|
||||
manager.migrate_starpilot_ce_model_stop_time(params, params_cache)
|
||||
|
||||
assert params.get("CEModelStopTime") == "9.0"
|
||||
assert params_cache.get("CEModelStopTime") == "9.0"
|
||||
assert params.get("CEModelStopTime") == "7.7"
|
||||
assert params_cache.get("CEModelStopTime") == "7.7"
|
||||
assert manager.STARPILOT_CE_MODEL_STOP_TIME_MIGRATION_FLAG.exists()
|
||||
|
||||
def test_migrate_starpilot_ce_model_stop_time_preserves_custom_value(self, tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(manager, "STARPILOT_CE_MODEL_STOP_TIME_MIGRATION_FLAG", tmp_path / "starpilot_ce_model_stop_time_v2")
|
||||
|
||||
params = FileBackedFakeParams(tmp_path / "params", {"CEModelStopTime": 8.0})
|
||||
params_cache = FileBackedFakeParams(tmp_path / "cache", {"CEModelStopTime": 8.0})
|
||||
|
||||
manager.migrate_starpilot_ce_model_stop_time(params, params_cache)
|
||||
|
||||
assert params.get("CEModelStopTime") == "8.0"
|
||||
assert params_cache.get("CEModelStopTime") == "8.0"
|
||||
|
||||
def test_migrate_disable_humanlike_defaults(self, tmp_path, monkeypatch):
|
||||
monkeypatch.setattr(manager, "STARPILOT_HUMANLIKE_DISABLE_MIGRATION_FLAG", tmp_path / "starpilot_humanlike_disable_v1")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user