Skip to content

Commit 39ecab3

Browse files
committed
test: assert no agenthub-config header on inner http client
1 parent 60ba6ed commit 39ecab3

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/chat/test_agenthub_config_default.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,22 @@ def test_env_var_is_honored(self, cls, monkeypatch):
6363
llm = cls()
6464
assert llm.client_settings.agenthub_config == "agentsplayground"
6565

66+
def test_no_agenthub_header_on_inner_http_client(self, cls):
67+
llm = cls()
68+
client = getattr(llm, "uipath_sync_client", None)
69+
if client is None:
70+
pytest.skip(f"{cls.__name__} has no uipath_sync_client to inspect")
71+
assert "x-uipath-agenthub-config" not in {key.lower() for key in client.headers}
72+
73+
def test_env_var_is_honored_on_inner_http_client(self, cls, monkeypatch):
74+
monkeypatch.setenv("UIPATH_AGENTHUB_CONFIG", "agentsplayground")
75+
llm = cls()
76+
client = getattr(llm, "uipath_sync_client", None)
77+
if client is None:
78+
pytest.skip(f"{cls.__name__} has no uipath_sync_client to inspect")
79+
normalized = {key.lower(): value for key, value in client.headers.items()}
80+
assert normalized.get("x-uipath-agenthub-config") == "agentsplayground"
81+
6682

6783
_UPSTREAM_CASES = [
6884
"uipath_langchain_client.clients.normalized.chat_models:UiPathChat",

0 commit comments

Comments
 (0)