test_refresh_aborts_when_user_declines_external_directory() — langchain Function Reference
Architecture documentation for the test_refresh_aborts_when_user_declines_external_directory() function in test_cli.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD b317815f_e664_9bee_dc59_7b850b671acb["test_refresh_aborts_when_user_declines_external_directory()"] 8f48d3cf_da07_6b86_6f4f_33b7967df9e0["test_cli.py"] b317815f_e664_9bee_dc59_7b850b671acb -->|defined in| 8f48d3cf_da07_6b86_6f4f_33b7967df9e0 style b317815f_e664_9bee_dc59_7b850b671acb fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/model-profiles/tests/unit_tests/test_cli.py lines 146–169
def test_refresh_aborts_when_user_declines_external_directory(
tmp_path: Path, mock_models_dev_response: dict
) -> None:
"""Test that refresh aborts when user declines writing to external directory."""
data_dir = tmp_path / "data"
data_dir.mkdir()
# 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="n"), # User declines
):
with pytest.raises(SystemExit) as exc_info:
refresh("anthropic", data_dir)
assert exc_info.value.code == 1
# Verify _profiles.py was NOT created
profiles_file = data_dir / "_profiles.py"
assert not profiles_file.exists()
Domain
Subdomains
Source
Frequently Asked Questions
What does test_refresh_aborts_when_user_declines_external_directory() do?
test_refresh_aborts_when_user_declines_external_directory() is a function in the langchain codebase, defined in libs/model-profiles/tests/unit_tests/test_cli.py.
Where is test_refresh_aborts_when_user_declines_external_directory() defined?
test_refresh_aborts_when_user_declines_external_directory() is defined in libs/model-profiles/tests/unit_tests/test_cli.py at line 146.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free