refactor(hermes_cli): repoint callable-api-key source-inspection test at the guard expression

This commit is contained in:
Teknium
2026-09-02 22:53:16 -07:00
parent c6f75a32ec
commit 1b8de3457d
+3 -3
View File
@@ -254,9 +254,9 @@ class TestCliEnsureRuntimeCredentialsCallable:
# module the method actually lives in now.
src = (Path(__file__).resolve().parent.parent.parent
/ "hermes_cli" / "cli_agent_setup_mixin.py").read_text()
# The fix introduces ``_is_callable_provider`` which gates the
# string-only check so callable token providers survive.
assert "_is_callable_provider = callable(api_key)" in src, (
# The fix gates the string-only check on ``callable(api_key)`` so callable
# token providers survive.
assert "if not callable(api_key) and not (isinstance(api_key, str) and api_key):" in src, (
"_ensure_runtime_credentials must preserve a callable "
"api_key (Entra ID bearer provider). Without the guard, the "
"callable is stringified to 'no-key-required' and Azure 401s."