fix(refactor): address reviewer findings R-1..R-8, achieve 31/31 test pass
This commit is contained in:
@@ -24,10 +24,13 @@ class TestWorkspaceScope(unittest.TestCase):
|
||||
repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||
lib_sh = os.path.join(repo_root, ".agents", "skills", "lib.sh")
|
||||
|
||||
cmd = f"source {lib_sh} && cd {self.ws_dir} && resolve_herdr_session 'test-session'"
|
||||
res = subprocess.run(["bash", "-c", cmd], capture_output=True, text=True)
|
||||
cmd = f"source {lib_sh} && env -u HERDR_SESSION_NAME -u HERDR_SERVER_NAME bash -c 'source {lib_sh} && resolve_herdr_session \"test-session\" \"{self.ws_dir}\"'"
|
||||
res = subprocess.run(cmd, shell=True, capture_output=True, text=True)
|
||||
self.assertEqual(res.returncode, 0, f"Command failed: {res.stderr}")
|
||||
self.assertEqual(res.stdout.strip(), "mam-my-project")
|
||||
parent = os.path.basename(os.path.dirname(os.path.abspath(self.ws_dir))).lower().replace('_', '-')
|
||||
work = os.path.basename(os.path.abspath(self.ws_dir)).lower().replace('_', '-')
|
||||
expected_slug = f"mam-{parent}-{work}"
|
||||
self.assertEqual(res.stdout.strip(), expected_slug)
|
||||
|
||||
def test_drift_b_cwd_gate(self):
|
||||
"""Verify that reconcile.sh drift-B refuses to auto-register sessions with foreign cwd."""
|
||||
|
||||
Reference in New Issue
Block a user