TestOllamaLLMUrlAuth Class — langchain Architecture
Architecture documentation for the TestOllamaLLMUrlAuth class in test_auth.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 95a4a2a6_17f4_5b11_dd3a_fa258956e7f3["TestOllamaLLMUrlAuth"] 24ba4b1a_1f94_bed7_6c96_5631284214c2["test_auth.py"] 95a4a2a6_17f4_5b11_dd3a_fa258956e7f3 -->|defined in| 24ba4b1a_1f94_bed7_6c96_5631284214c2 d71e22d3_e0a6_cb9d_7b27_255faed3a30f["test_ollama_llm_url_auth_integration()"] 95a4a2a6_17f4_5b11_dd3a_fa258956e7f3 -->|method| d71e22d3_e0a6_cb9d_7b27_255faed3a30f
Relationship Graph
Source Code
libs/partners/ollama/tests/unit_tests/test_auth.py lines 145–168
class TestOllamaLLMUrlAuth:
"""Test URL authentication integration with OllamaLLM."""
@patch("langchain_ollama.llms.Client")
@patch("langchain_ollama.llms.AsyncClient")
def test_ollama_llm_url_auth_integration(
self, mock_async_client: MagicMock, mock_client: MagicMock
) -> None:
"""Test that OllamaLLM properly handles URL authentication."""
url_with_auth = "https://user:password@ollama.example.com:11434"
OllamaLLM(
model=MODEL_NAME,
base_url=url_with_auth,
)
expected_url = "https://ollama.example.com:11434"
expected_credentials = base64.b64encode(b"user:password").decode()
expected_headers = {"Authorization": f"Basic {expected_credentials}"}
mock_client.assert_called_once_with(host=expected_url, headers=expected_headers)
mock_async_client.assert_called_once_with(
host=expected_url, headers=expected_headers
)
Source
Frequently Asked Questions
What is the TestOllamaLLMUrlAuth class?
TestOllamaLLMUrlAuth is a class in the langchain codebase, defined in libs/partners/ollama/tests/unit_tests/test_auth.py.
Where is TestOllamaLLMUrlAuth defined?
TestOllamaLLMUrlAuth is defined in libs/partners/ollama/tests/unit_tests/test_auth.py at line 145.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free