MCPcopy Create free account
hub / github.com/FastLED/FastLED / extract_test_cases

Function extract_test_cases

mcp_server.py:719–739  ·  view source on GitHub ↗

Extract TEST_CASE names from a test file.

(file_path: Path, search_pattern: str = "")

Source from the content-addressed store, hash-verified

717
718
719def extract_test_cases(file_path: Path, search_pattern: str = "") -> list[str]:
720 """Extract TEST_CASE names from a test file."""
721 test_cases: list[str] = []
722
723 try:
724 with open(file_path, "r", encoding="utf-8") as f:
725 content = f.read()
726
727 # Find TEST_CASE macros using regex
728 pattern = r'TEST_CASE\s*\(\s*"([^"]+)"'
729 matches = re.findall(pattern, content)
730
731 for match in matches:
732 if not search_pattern or search_pattern.lower() in match.lower():
733 test_cases.append(match)
734
735 except Exception:
736 # Silently skip files that can't be read
737 pass
738
739 return test_cases
740
741
742async def test_instructions(

Callers 1

list_test_casesFunction · 0.85

Calls 2

readMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected