#!/usr/bin/env python3 """Tests actual GLB bundle publication without requiring Blender's GUI/Python runtime.""" import hashlib import importlib.util import json from pathlib import Path import struct import tempfile import sys sys.dont_write_bytecode = True import unittest import uuid MODULE = Path(__file__).resolve().parents[1] / "tools/blender_addon/bundle.py" spec = importlib.util.spec_from_file_location("faset_bundle", MODULE) bundle = importlib.util.module_from_spec(spec) spec.loader.exec_module(bundle) def glb(path, identity, name="Door", duplicate=False): nodes = [{"name": name, "extras": {"faset_id": identity}}] if duplicate: nodes.append(nodes[0].copy()) doc = {"asset": {"version": "2.0"}, "scene": 0, "scenes": [{"nodes": [0]}], "nodes": nodes} raw = json.dumps(doc).encode() raw += b" " * (-len(raw) % 4) path.write_bytes(struct.pack("