MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / test_anchored_multi_segment_pattern

Function test_anchored_multi_segment_pattern

tests/test_detect.py:683–699  ·  view source on GitHub ↗

/src/inbox/ must match src/inbox/ but not x/src/inbox/.

(tmp_path)

Source from the content-addressed store, hash-verified

681
682
683def test_anchored_multi_segment_pattern(tmp_path):
684 """/src/inbox/ must match src/inbox/ but not x/src/inbox/."""
685 from graphify.detect import _is_ignored, _load_graphifyignore
686 (tmp_path / "src" / "inbox").mkdir(parents=True)
687 (tmp_path / "x" / "src" / "inbox").mkdir(parents=True)
688 target_ok = tmp_path / "src" / "inbox" / "a.py"
689 target_ok.write_text("x=1")
690 target_bad = tmp_path / "x" / "src" / "inbox" / "b.py"
691 target_bad.write_text("x=1")
692 (tmp_path / ".graphifyignore").write_text("/src/inbox/\n")
693 patterns = _load_graphifyignore(tmp_path)
694 assert _is_ignored(target_ok, tmp_path, patterns), (
695 "src/inbox/a.py must be ignored by /src/inbox/"
696 )
697 assert not _is_ignored(target_bad, tmp_path, patterns), (
698 "x/src/inbox/b.py must NOT be ignored by /src/inbox/"
699 )
700
701
702# Tests for #1235 - memoise _is_ignored/_eval results via a per-detect() cache

Callers

nothing calls this directly

Calls 2

_load_graphifyignoreFunction · 0.90
_is_ignoredFunction · 0.90

Tested by

no test coverage detected