Home / Function/ test_ollama_llm_url_auth_integration() — langchain Function Reference

test_ollama_llm_url_auth_integration() — langchain Function Reference

Architecture documentation for the test_ollama_llm_url_auth_integration() function in test_auth.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  d71e22d3_e0a6_cb9d_7b27_255faed3a30f["test_ollama_llm_url_auth_integration()"]
  95a4a2a6_17f4_5b11_dd3a_fa258956e7f3["TestOllamaLLMUrlAuth"]
  d71e22d3_e0a6_cb9d_7b27_255faed3a30f -->|defined in| 95a4a2a6_17f4_5b11_dd3a_fa258956e7f3
  style d71e22d3_e0a6_cb9d_7b27_255faed3a30f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/ollama/tests/unit_tests/test_auth.py lines 150–168

    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
        )

Domain

Subdomains

Frequently Asked Questions

What does test_ollama_llm_url_auth_integration() do?
test_ollama_llm_url_auth_integration() is a function in the langchain codebase, defined in libs/partners/ollama/tests/unit_tests/test_auth.py.
Where is test_ollama_llm_url_auth_integration() defined?
test_ollama_llm_url_auth_integration() is defined in libs/partners/ollama/tests/unit_tests/test_auth.py at line 150.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free