MCPcopy
hub / github.com/tirth8205/code-review-graph / setup_method

Method setup_method

tests/test_tools.py:661–675  ·  view source on GitHub ↗

Set up a temp dir with .git and .code-review-graph, seed data, build flows.

(self)

Source from the content-addressed store, hash-verified

659 """Tests for flow-related MCP tool functions."""
660
661 def setup_method(self):
662 """Set up a temp dir with .git and .code-review-graph, seed data, build flows."""
663 self.tmp_dir = tempfile.mkdtemp()
664 # Resolve symlinks (macOS /var -> /private/var) so paths match
665 # what _validate_repo_root returns via Path.resolve().
666 self.root = Path(self.tmp_dir).resolve()
667
668 # Create markers so _validate_repo_root accepts this directory
669 (self.root / ".git").mkdir()
670 (self.root / ".code-review-graph").mkdir()
671
672 db_path = str(self.root / ".code-review-graph" / "graph.db")
673 self.store = GraphStore(db_path)
674 self._seed_data()
675 self._build_flows()
676
677 def teardown_method(self):
678 self.store.close()

Callers

nothing calls this directly

Calls 3

_seed_dataMethod · 0.95
_build_flowsMethod · 0.95
GraphStoreClass · 0.90

Tested by

no test coverage detected