Private
Public Access
0
0

test(arch-boundary): migrate whitelist test to tmp_path; fix indentation

This commit is contained in:
2026-06-02 21:34:56 -04:00
parent 1660114bc7
commit 7646fc14a2
+16 -13
View File
@@ -20,19 +20,22 @@ class TestArchBoundaryPhase1(unittest.TestCase):
self.assertNotIn("UNFETTERED_MODULES", content)
def test_mcp_client_whitelist_enforcement(self) -> None:
"""TEST 2: mcp_client._is_allowed must return False for config.toml"""
from src import mcp_client
from pathlib import Path
# Configure with some dummy file items (as dicts)
file_items = [{"path": "src/gui_2.py"}]
mcp_client.configure(file_items, [])
# Should allow src files
self.assertTrue(mcp_client._is_allowed(Path("src/gui_2.py")))
# Should REJECT config files
self.assertFalse(mcp_client._is_allowed(Path("config.toml")))
self.assertFalse(mcp_client._is_allowed(Path("credentials.toml")))
"""TEST 2: mcp_client._is_allowed must return False for config.toml"""
import tempfile
from src import mcp_client
from pathlib import Path
tmp = Path(tempfile.mkdtemp())
# Configure with some dummy file items (as dicts)
file_items = [{"path": "src/gui_2.py"}]
mcp_client.configure(file_items, [])
# Should allow src files
self.assertTrue(mcp_client._is_allowed(Path("src/gui_2.py")))
# Should REJECT config files (using tmp_path versions; check is by basename)
self.assertFalse(mcp_client._is_allowed(tmp / "config.toml"))
self.assertFalse(mcp_client._is_allowed(tmp / "credentials.toml"))
def test_mma_exec_no_hardcoded_path(self) -> None:
"""TEST 4: mma_exec.execute_agent must not contain hardcoded machine paths."""