[kimi] Break up _dispatch_via_gitea() into helper functions (#1136) (#1183)

This commit is contained in:
2026-03-23 21:40:17 +00:00
parent 74bf0606a9
commit 7aa48b4e22
26 changed files with 195 additions and 115 deletions

View File

@@ -561,9 +561,8 @@ class TestModelPostInit:
env = {k: v for k, v in os.environ.items() if k != "GITEA_TOKEN"}
with patch.dict(os.environ, env, clear=True):
s = Settings()
# Override repo_root so post_init finds our temp file
original_compute = s._compute_repo_root
# Override repo_root so post_init finds our temp file
def _fake_root():
return str(tmp_path)
@@ -704,7 +703,6 @@ class TestGetEffectiveOllamaModel:
from config import get_effective_ollama_model, settings
# Make primary unavailable, but one fallback available
primary = settings.ollama_model
fallback_target = settings.fallback_models[0]
def side_effect(model):
@@ -804,9 +802,7 @@ class TestValidateStartup:
with patch.object(config.settings, "timmy_env", "production"):
with patch.object(config.settings, "l402_hmac_secret", "secret1"):
with patch.object(config.settings, "l402_macaroon_secret", "secret2"):
with patch.object(
config.settings, "cors_origins", ["http://localhost:3000"]
):
with patch.object(config.settings, "cors_origins", ["http://localhost:3000"]):
config.validate_startup(force=True)
assert config._startup_validated is True