- Added properties for Omoo DA3 settings in properties.py, including input path, video frames, model selection, and export format. - Created runtime management in runtime.py, handling model downloads, job paths, and command execution for reconstruction. - Developed status bar functionality in status_bar.py to display job progress and status. - Implemented worker.py for image and video processing, including frame extraction and model inference. - Added comprehensive unit tests covering addon registration, model handling, export processes, and UI interactions. - Included a lock file for dependency management with uv.
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
import importlib.util
|
|
import tempfile
|
|
import unittest
|
|
from pathlib import Path
|
|
from zipfile import ZipFile
|
|
|
|
|
|
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
def load_pack():
|
|
specification = importlib.util.spec_from_file_location(
|
|
"omoo_da3_pack",
|
|
PROJECT_ROOT / "pack.py",
|
|
)
|
|
module = importlib.util.module_from_spec(specification)
|
|
specification.loader.exec_module(module)
|
|
return module
|
|
|
|
|
|
class PackTest(unittest.TestCase):
|
|
def test_builds_extension_root_layout(self):
|
|
pack = load_pack()
|
|
with tempfile.TemporaryDirectory() as directory:
|
|
original_dist = pack.DIST_DIR
|
|
pack.DIST_DIR = Path(directory)
|
|
try:
|
|
output_path = pack.build_extension()
|
|
finally:
|
|
pack.DIST_DIR = original_dist
|
|
|
|
with ZipFile(output_path) as archive:
|
|
names = set(archive.namelist())
|
|
|
|
self.assertIn("__init__.py", names)
|
|
self.assertIn("blender_manifest.toml", names)
|
|
self.assertIn("worker.py", names)
|
|
self.assertNotIn("importer.py", names)
|
|
self.assertNotIn("omoo_da3/__init__.py", names)
|