feat(php): php projects support added
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import importlib.util
|
||||
import io
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
import textwrap
|
||||
@@ -8,7 +9,18 @@ from contextlib import redirect_stdout
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
SCRIPT_PATH = Path("/Users/alexeus/.codex/skills/codespaces/scripts/belief_search.py")
|
||||
# Resolve belief_search.py via env override, relative path from this test file,
|
||||
# or the legacy absolute path (last resort). Keeps tests runnable on any machine.
|
||||
SCRIPT_PATH = Path(
|
||||
os.environ.get(
|
||||
"BELIEF_SEARCH_PATH",
|
||||
Path(__file__).resolve().parent.parent / "scripts" / "belief_search.py",
|
||||
)
|
||||
)
|
||||
if not SCRIPT_PATH.exists():
|
||||
SCRIPT_PATH = Path(
|
||||
"/Users/alexeus/.codex/skills/codespaces/scripts/belief_search.py"
|
||||
)
|
||||
SPEC = importlib.util.spec_from_file_location("belief_search", SCRIPT_PATH)
|
||||
belief_search = importlib.util.module_from_spec(SPEC)
|
||||
assert SPEC.loader is not None
|
||||
@@ -57,7 +69,9 @@ class BeliefSearchAliasTest(unittest.TestCase):
|
||||
|
||||
self.assertEqual(
|
||||
graph.resolve_module("asp543"),
|
||||
["app-service/app-service/src/workspace-operatives/workspace-operative.service"],
|
||||
[
|
||||
"app-service/app-service/src/workspace-operatives/workspace-operative.service"
|
||||
],
|
||||
)
|
||||
|
||||
output = io.StringIO()
|
||||
@@ -104,7 +118,10 @@ class BeliefSearchAliasTest(unittest.TestCase):
|
||||
"(boundary-file app-service/app-service/src/workspace-operatives/workspace-operative.service",
|
||||
text,
|
||||
)
|
||||
self.assertNotIn("(boundary app-service/app-service/src/workspace-operatives/workspace-operative.service", text)
|
||||
self.assertNotIn(
|
||||
"(boundary app-service/app-service/src/workspace-operatives/workspace-operative.service",
|
||||
text,
|
||||
)
|
||||
|
||||
def test_quick_resolves_alias_from_raw_search_hits(self) -> None:
|
||||
"""/* REQ-CS-004: quick must resolve legacy path-map aliases found in raw belief-map facts. */"""
|
||||
@@ -125,7 +142,9 @@ class BeliefSearchAliasTest(unittest.TestCase):
|
||||
|
||||
output = io.StringIO()
|
||||
with redirect_stdout(output):
|
||||
belief_search.cmd_boundary(graph, "workspace-operative.service", files_only=True)
|
||||
belief_search.cmd_boundary(
|
||||
graph, "workspace-operative.service", files_only=True
|
||||
)
|
||||
|
||||
self.assertEqual(
|
||||
output.getvalue().strip().splitlines(),
|
||||
@@ -144,7 +163,9 @@ class BeliefSearchAliasTest(unittest.TestCase):
|
||||
belief_search.cmd_analyze(graph, "workspace-operative.controller")
|
||||
|
||||
text = output.getvalue()
|
||||
self.assertIn("(error no-match workspace-operative.controller :suggestions", text)
|
||||
self.assertIn(
|
||||
"(error no-match workspace-operative.controller :suggestions", text
|
||||
)
|
||||
self.assertIn("workspace-operative.service", text)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user