Home / Function/ test_refresh_generates_profiles_file() — langchain Function Reference

test_refresh_generates_profiles_file() — langchain Function Reference

Architecture documentation for the test_refresh_generates_profiles_file() function in test_cli.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  e7be4334_f5f3_bb21_4fa4_c5c3951676b2["test_refresh_generates_profiles_file()"]
  8f48d3cf_da07_6b86_6f4f_33b7967df9e0["test_cli.py"]
  e7be4334_f5f3_bb21_4fa4_c5c3951676b2 -->|defined in| 8f48d3cf_da07_6b86_6f4f_33b7967df9e0
  style e7be4334_f5f3_bb21_4fa4_c5c3951676b2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/model-profiles/tests/unit_tests/test_cli.py lines 52–93

def test_refresh_generates_profiles_file(
    tmp_path: Path, mock_models_dev_response: dict
) -> None:
    """Test that refresh command generates _profiles.py with merged data."""
    data_dir = tmp_path / "data"
    data_dir.mkdir()

    # Create augmentations file
    aug_file = data_dir / "profile_augmentations.toml"
    aug_file.write_text("""
provider = "anthropic"

[overrides]
image_url_inputs = true
pdf_inputs = true
""")

    # Mock the httpx.get call
    mock_response = Mock()
    mock_response.json.return_value = mock_models_dev_response
    mock_response.raise_for_status = Mock()

    with (
        patch("langchain_model_profiles.cli.httpx.get", return_value=mock_response),
        patch("builtins.input", return_value="y"),
    ):
        refresh("anthropic", data_dir)

    # Verify _profiles.py was created
    profiles_file = data_dir / "_profiles.py"
    assert profiles_file.exists()

    # Import and verify content
    profiles_content = profiles_file.read_text()
    assert "DO NOT EDIT THIS FILE MANUALLY" in profiles_content
    assert "PROFILES:" in profiles_content
    assert "claude-3-opus" in profiles_content
    assert "claude-3-sonnet" in profiles_content

    # Check that augmentations were applied
    assert "image_url_inputs" in profiles_content
    assert "pdf_inputs" in profiles_content

Domain

Subdomains

Frequently Asked Questions

What does test_refresh_generates_profiles_file() do?
test_refresh_generates_profiles_file() is a function in the langchain codebase, defined in libs/model-profiles/tests/unit_tests/test_cli.py.
Where is test_refresh_generates_profiles_file() defined?
test_refresh_generates_profiles_file() is defined in libs/model-profiles/tests/unit_tests/test_cli.py at line 52.

Analyze Your Own Codebase

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

Try Supermodel Free