Minecraft-Console-Client/tools/tests/test_pathing_live_scripts.py
BruceChen 418f17b4a1 pathing: add side-wall theory, full-coverage parkour test suite, and live test fixes
Theory simulator:
- Add 2D side-wall jump physics with yaw sweep for worst-case margin
- Generate sidewall theory cases (flat/ascend/descend, wall_offset 0/1)
- Add momentum-capabilities.json with band compression and max_reach
- Extend models, capabilities, canonical, and renderers for sidewall

Full-coverage parkour test suite (tools/test-parkour.py):
- Derive test matrix from momentum-capabilities.json
- Build linear/neo/ceiling courses via RCON with 7-block clear margin
- Use /goto for pathfinding, parse A* and PathMgr log output
- Stop-at-first-failure per (family, subfamily, dy, ceil, wo) group
- Hierarchical --filter (e.g. linear/flat, ceiling/headhitter/ceil2.5)
- Exclude sidewall from default matrix (identical max_reach to linear)

Pathing execution fixes:
- Align parkour contracts and timing budgets with live test results
- Fix jump-entry yaw snapping for grounded handoffs
- Template helper and sprint jump template refinements

Made-with: Cursor
2026-04-15 17:52:47 +00:00

66 lines
2.4 KiB
Python

import subprocess
import unittest
class PathingLiveScriptTests(unittest.TestCase):
def test_test_parkour_lists_all_families(self) -> None:
result = subprocess.run(
["python3", "tools/test-parkour.py", "--list-cases"],
check=False,
capture_output=True,
text=True,
)
self.assertEqual(result.returncode, 0, result.stderr)
self.assertIn("linear/flat", result.stdout)
self.assertIn("linear/ascend", result.stdout)
self.assertIn("linear/descend", result.stdout)
self.assertIn("neo/neo", result.stdout)
self.assertIn("ceiling/headhitter", result.stdout)
self.assertIn("sidewall/flat", result.stdout)
self.assertIn("sidewall/ascend", result.stdout)
self.assertIn("sidewall/descend", result.stdout)
def test_test_parkour_linear_has_reject_at_max_plus_one(self) -> None:
result = subprocess.run(
["python3", "tools/test-parkour.py", "--list-cases", "--family", "linear"],
check=False,
capture_output=True,
text=True,
)
self.assertEqual(result.returncode, 0, result.stderr)
self.assertIn("linear-flat-gap4", result.stdout)
self.assertIn("linear-flat-gap5", result.stdout)
self.assertIn("[PASS]", result.stdout)
self.assertIn("[REJECT]", result.stdout)
def test_test_parkour_neo_covers_wall_range(self) -> None:
result = subprocess.run(
["python3", "tools/test-parkour.py", "--list-cases", "--family", "neo"],
check=False,
capture_output=True,
text=True,
)
self.assertEqual(result.returncode, 0, result.stderr)
for w in range(5):
self.assertIn(f"neo-neo-wall{w}", result.stdout)
self.assertIn("neo-neo-wall5", result.stdout)
self.assertIn("[REJECT]", result.stdout)
def test_test_pathing_theory_neo_ceiling_lists_theory_cases(self) -> None:
result = subprocess.run(
["bash", "tools/test-pathing-theory-neo-ceiling.sh", "--list-cases"],
check=False,
capture_output=True,
text=True,
)
self.assertEqual(result.returncode, 0, result.stderr)
self.assertIn("neo-neo-sprint-mm12-wall1", result.stdout)
self.assertIn("ceiling-headhitter-sprint-mm12-gap3-ceil2p5", result.stdout)
if __name__ == "__main__":
unittest.main()