mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-20 03:31:59 +02:00
[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:
parent
424abbff82
commit
3c57afb4d0
8 changed files with 76 additions and 77 deletions
|
@ -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("")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue