mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-07-16 12:40:18 +00:00
test(#5619): carry config path through quota helper state
This commit is contained in:
@@ -49,15 +49,18 @@ def _with_config(model=None, providers=None):
|
|||||||
except Exception:
|
except Exception:
|
||||||
config._cfg_mtime = 0.0
|
config._cfg_mtime = 0.0
|
||||||
config._cfg_path = config._get_config_path()
|
config._cfg_path = config._get_config_path()
|
||||||
_restore_config._old_path = old_path
|
return old_cfg, (old_mtime, old_path)
|
||||||
return old_cfg, old_mtime
|
|
||||||
|
|
||||||
|
|
||||||
def _restore_config(old_cfg, old_mtime):
|
def _restore_config(old_cfg, old_mtime):
|
||||||
|
if isinstance(old_mtime, tuple):
|
||||||
|
old_mtime, old_path = old_mtime
|
||||||
|
else:
|
||||||
|
old_path = getattr(config, "_cfg_path", None)
|
||||||
config.cfg.clear()
|
config.cfg.clear()
|
||||||
config.cfg.update(old_cfg)
|
config.cfg.update(old_cfg)
|
||||||
config._cfg_mtime = old_mtime
|
config._cfg_mtime = old_mtime
|
||||||
config._cfg_path = getattr(_restore_config, "_old_path", None)
|
config._cfg_path = old_path
|
||||||
|
|
||||||
|
|
||||||
def test_openrouter_quota_fetches_key_endpoint_and_sanitizes_response(monkeypatch, tmp_path):
|
def test_openrouter_quota_fetches_key_endpoint_and_sanitizes_response(monkeypatch, tmp_path):
|
||||||
|
|||||||
Reference in New Issue
Block a user