[tests] Simplify registration/unregistration of nodes in tests

Add two methods that are local to tests, `registerNodeDesc` and
`unregisterNodeDesc`, which handle the registration and unregistration
of `NodePlugins` from a node description. This reduces the amount of
code in tests whenever `NodePlugin` need to be instantiated prior
to their registration and so on.
This commit is contained in:
Candice Bentéjac 2025-06-04 21:18:16 +02:00
parent 424abbff82
commit 3c57afb4d0
8 changed files with 76 additions and 77 deletions

View file

@ -2,7 +2,8 @@
# coding:utf-8
from meshroom.core.graph import Graph
from meshroom.core import desc, pluginManager
from meshroom.core.plugins import NodePlugin
from .utils import registerNodeDesc
class SampleNode(desc.Node):
@ -17,8 +18,7 @@ class SampleNode(desc.Node):
desc.File(name='output', label='Output', description='', value="{nodeCacheFolder}")
]
nodePlugin = NodePlugin(SampleNode)
pluginManager.registerNode(nodePlugin) # register standalone NodePlugin
registerNodeDesc(SampleNode) # register standalone NodePlugin
def test_output_invalidation():
graph = Graph("")