Include selected source LOD in Worker scene package

This commit is contained in:
DCCONSTRUCTIONS
2026-10-09 22:28:06 +03:00
parent 37d6f90456
commit be5cc98d5c
3 changed files with 30 additions and 6 deletions
+19
View File
@@ -72,3 +72,22 @@ def test_paired_import_checks_actual_files_and_never_fetches_from_operator(tmp_p
preparer.prepare_terrain(root, tmp_path, {**world, "collider_sha256": "f" * 64})
with pytest.raises(ValueError, match="identity"):
importer.stage(root, source, collider, {**descriptor, "collider_sha256": "f" * 64})
def test_project_package_supports_each_published_lod_without_cropping(monkeypatch):
from types import SimpleNamespace
from k1link.simulation.ai_polygon.project_worlds import ProjectWorlds
monkeypatch.syspath_prepend(str(Path(__file__).parents[1] / "simulation/ai-polygon"))
module = importlib.import_module("project_assets")
paths = ["streamed/lod-meta.json", "collision.glb", "streamed/env/meta.json",
"streamed/0_0/meta.json", "streamed/1_0/meta.json", "streamed/1_0/means_l.webp",
"streamed/2_0/meta.json", "private/source.zip"]
project = dict(project_id="sim-test", provider={"job_id":"gsp-test"},
artifacts=[dict(logical_path=name) for name in paths])
worlds = object.__new__(ProjectWorlds)
worlds.projects = SimpleNamespace(get=lambda _: project)
prefix = "/api/v1/simulation-worlds/projects/sim-test/artifacts/"
package = worlds.package(dict(storage={"project_id":"sim-test"}, sha256="test",
local_scene=dict(visual_url=prefix+paths[0], collision_url=prefix+paths[1])))
assert [item["logical_path"] for item in package["artifacts"]] == paths[:-1]
assert [item["logical_path"] for item in module.project_members(package, 1)] == paths[:3]+paths[4:6]