Home / Function/ test_chat_ollama_url_auth_integration() — langchain Function Reference

test_chat_ollama_url_auth_integration() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  107ba097_78f8_bd04_b4aa_a5819e5aec8c["test_chat_ollama_url_auth_integration()"]
  6e62971c_d6df_2bdd_2586_c755947c90ab["TestChatOllamaUrlAuth"]
  107ba097_78f8_bd04_b4aa_a5819e5aec8c -->|defined in| 6e62971c_d6df_2bdd_2586_c755947c90ab
  style 107ba097_78f8_bd04_b4aa_a5819e5aec8c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/ollama/tests/unit_tests/test_auth.py lines 95–114

    def test_chat_ollama_url_auth_integration(
        self, mock_async_client: MagicMock, mock_client: MagicMock
    ) -> None:
        """Test that ChatOllama properly handles URL authentication."""
        url_with_auth = "https://user:password@ollama.example.com:11434"

        ChatOllama(
            model=MODEL_NAME,
            base_url=url_with_auth,
        )

        # Verify the clients were called with cleaned URL and auth headers
        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_chat_ollama_url_auth_integration() do?
test_chat_ollama_url_auth_integration() is a function in the langchain codebase, defined in libs/partners/ollama/tests/unit_tests/test_auth.py.
Where is test_chat_ollama_url_auth_integration() defined?
test_chat_ollama_url_auth_integration() is defined in libs/partners/ollama/tests/unit_tests/test_auth.py at line 95.

Analyze Your Own Codebase

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

Try Supermodel Free