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

@@ -214,6 +214,13 @@ def main():
]
assert len(surface_group_nodes) == 1
assert surface_group_nodes[0].name == "O DA3 Surface Layer"
surface_inputs = [
item.name
for item in surface_group.interface.items_tree
if item.item_type == "SOCKET"
and item.in_out == "INPUT"
]
assert surface_inputs == ["Color", "Alpha", "Bump Scale"]
surface_outputs = [
item.name
for item in surface_group.interface.items_tree
@@ -232,14 +239,6 @@ def main():
and item.name == "Background"
for item in refine_group.interface.items_tree
)
surface_depth_input = next(
item
for item in surface_group.interface.items_tree
if item.item_type == "SOCKET"
and item.in_out == "INPUT"
and item.name == "Depth"
)
assert surface_depth_input.socket_type == "NodeSocketFloat"
assert not any(
node.bl_idname in forbidden_outer_nodes
for node in surface_material.node_tree.nodes