Official Codebase of 3DCodeVerse
Python
tests: four tests a candidate filter hid — a real-Blender drawer and bad-pivot build, two skills switch checks (−45 lines)
gaoypeng4b636292688c
diff --git a/harness/tests/skills/test_config.py b/harness/tests/skills/test_config.pyindex 5c900ce9..63c1639a 100644--- a/harness/tests/skills/test_config.py+++ b/harness/tests/skills/test_config.py@@ -5,7 +5,6 @@ from __future__ import annotationsimport pytestfrom codeverse3d.config import Settings, get_settings-from codeverse3d.tracks.plan_features import dead_env_keysdef _settings(monkeypatch, **env: str) -> Settings:@@ -28,10 +27,6 @@ def test_max_is_never_a_crash(monkeypatch, raw, want):assert _settings(monkeypatch, C3D_SKILLS_MAX=raw).skills_max == want-def test_the_switches_are_live():- assert dead_env_keys(dict.fromkeys(("C3D_SKILLS", "C3D_SKILLS_MAX", "C3D_SKILLS_UNVERIFIED",- "C3D_SKILLS_ONLY", "C3D_SKILLS_DIR"), "1")) == []-def test_doctor_reports_the_default_and_the_gemini_pin(monkeypatch):"""ON is healthy, and gemini-cli's skills.enabled must be pinned per session."""diff --git a/harness/tests/skills/test_loader.py b/harness/tests/skills/test_loader.pyindex 7043e59d..d09f8dad 100644--- a/harness/tests/skills/test_loader.py+++ b/harness/tests/skills/test_loader.py@@ -89,13 +89,3 @@ def test_load_skill_by_name(tmp_path: Path):assert load_skill("c3d-demo", tmp_path).name == "c3d-demo"with pytest.raises(SkillError, match="no skill"):load_skill("c3d-missing", tmp_path)---def test_the_library_dir_is_overridable_for_tests_and_the_live_smoke(tmp_path: Path, monkeypatch):- from codeverse3d.config import get_settings- from codeverse3d.skills import skills_dir-- write_bundle(tmp_path, "c3d-demo")- monkeypatch.setenv("C3D_SKILLS_DIR", str(tmp_path))- get_settings.cache_clear()- assert skills_dir() == tmp_pathdiff --git a/harness/tests/urdf_joints/test_live_blender.py b/harness/tests/urdf_joints/test_live_blender.pyindex 011ed5d3..dfb97ff9 100644--- a/harness/tests/urdf_joints/test_live_blender.py+++ b/harness/tests/urdf_joints/test_live_blender.py@@ -1,4 +1,4 @@-"""Real Blender builds (marked ``blender``): cabinet+door, drawer, bad pivot, yourdfpy."""+"""Real Blender builds (marked ``blender``): cabinet+door with yourdfpy FK, a rest-shifted drawer, wrapper failures."""from __future__ import annotations@@ -60,36 +60,6 @@ def test_rest_shifted_skeleton_builds_clean(tmp_path, drawer_plan):assert not [f for f in sweep_gate(ws)[0].findings if f.data.get("kind") == "penetration"]-@needs_blender-def test_drawer_prismatic(tmp_path, drawer_plan):- ws = Workspace(tmp_path / "drawer").create()- rt = UrdfBlenderRuntime()- rt.skeleton(ws, drawer_plan)- res = rt.build(ws)- assert res.ok, res.error_message- r = load_urdf(ws.artifacts / "robot.urdf", ws.artifacts / "meshes")- c0 = link_world_meshes(r)["drawer"].centroid- c1 = link_world_meshes(r, {"slide": 0.3})["drawer"].centroid- assert np.allclose(c1 - c0, [0, -0.3, 0], atol=1e-6)- assert not [f for f in sweep_gate(ws)[0].findings if f.data.get("kind") == "penetration"]---@needs_blender-def test_bad_pivot_is_caught(tmp_path, cabinet_plan):- ws = Workspace(tmp_path / "bad").create()- rt = UrdfBlenderRuntime()- rt.skeleton(ws, cabinet_plan)- u = ws.src / "robot.urdf"- # hinge moved to the door's middle: the door must sweep into the body- u.write_text(u.read_text().replace('<origin xyz="-0.29 -0.2 0" rpy="0 0 0"/> <!-- pivot', '<origin xyz="0 -0.2 0" rpy="0 0 0"/> <!-- pivot')- .replace('xyz="0.29 0.2 0"', 'xyz="0 0.2 0"').replace('xyz="0.49 -0.04 0.4"', 'xyz="0.2 -0.04 0.4"'))- res = rt.build(ws)- assert res.ok # rest pose is still fine; the round's joint_sweep gate reports the defect- gate, _ = sweep_gate(ws)- pen = next(f for f in gate.errors if f.target == "body|door")- assert pen.data["max_depth_m"] > 0.05 and {"hinge": 1.57} in pen.data["poses"]--@needs_blenderdef test_script_error_and_missing_object(tmp_path, cabinet_plan):ws = Workspace(tmp_path / "err").create()