Home / Function/ test_grep_with_include_filter() — langchain Function Reference

test_grep_with_include_filter() — langchain Function Reference

Architecture documentation for the test_grep_with_include_filter() function in test_file_search.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  50157096_a725_df3a_96fc_da0f46bcfad9["test_grep_with_include_filter()"]
  cc6c9310_5391_59ed_60fd_270a44975195["TestFilesystemGrepSearch"]
  50157096_a725_df3a_96fc_da0f46bcfad9 -->|defined in| cc6c9310_5391_59ed_60fd_270a44975195
  style 50157096_a725_df3a_96fc_da0f46bcfad9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/anthropic/tests/unit_tests/middleware/test_file_search.py lines 301–331

    def test_grep_with_include_filter(self) -> None:
        """Test grep with include file pattern filter."""
        middleware = StateFileSearchMiddleware()

        state: AnthropicToolsState = {
            "messages": [],
            "text_editor_files": {
                "/src/main.py": {
                    "content": ["import os"],
                    "created_at": "2025-01-01T00:00:00",
                    "modified_at": "2025-01-01T00:00:00",
                },
                "/src/main.ts": {
                    "content": ["import os from 'os'"],
                    "created_at": "2025-01-01T00:00:00",
                    "modified_at": "2025-01-01T00:00:00",
                },
            },
        }

        result = middleware._handle_grep_search(
            pattern="import",
            path="/",
            include="*.py",
            output_mode="files_with_matches",
            state=state,
        )

        assert isinstance(result, str)
        assert "/src/main.py" in result
        assert "/src/main.ts" not in result

Domain

Subdomains

Frequently Asked Questions

What does test_grep_with_include_filter() do?
test_grep_with_include_filter() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/unit_tests/middleware/test_file_search.py.
Where is test_grep_with_include_filter() defined?
test_grep_with_include_filter() is defined in libs/partners/anthropic/tests/unit_tests/middleware/test_file_search.py at line 301.

Analyze Your Own Codebase

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

Try Supermodel Free