Add unit tests for service functionality and model caching

- Implement tests for ben2 and da3 model caching to ensure models are reused for matching runtime keys.
- Verify service state management, including client registration, job cancellation, and client expiration.
- Test discovery file creation and removal based on service ownership.
- Ensure frame extraction functionality works without models and produces expected results.
This commit is contained in:
2026-08-13 00:35:40 +08:00
parent 7d0983529e
commit 92d2cea1d1
21 changed files with 935 additions and 887 deletions

View File

@@ -517,13 +517,13 @@ class ConvertImageToMesh(bpy.types.Operator):
def poll(cls, context):
from .models import MODELS
from .operators import active_job
from .runtime import host_busy, model_ready
from .client import service_busy, model_ready
return (
is_image_empty(context.object)
and video_total_frames(context.object.data) == 1
and active_job() is None
and not host_busy()
and not service_busy()
and any(model_ready(model_key) for model_key in MODELS)
)