MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / _install_mock_transport

Function _install_mock_transport

python/openshell/sandbox_test.py:575–584  ·  view source on GitHub ↗

Swap the refresher's httpx.Client for one bound to a mock transport. We rebuild with `follow_redirects=False` so the redirect-rejection test still exercises the real policy.

(refresher: Any, transport: Any)

Source from the content-addressed store, hash-verified

573
574
575def _install_mock_transport(refresher: Any, transport: Any) -> None:
576 """Swap the refresher's httpx.Client for one bound to a mock transport.
577
578 We rebuild with `follow_redirects=False` so the redirect-rejection
579 test still exercises the real policy.
580 """
581 import httpx as _httpx
582
583 refresher._http.close()
584 refresher._http = _httpx.Client(transport=transport, follow_redirects=False)
585
586
587def test_refresher_returns_cached_token_when_fresh(tmp_path: Path) -> None:

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected