mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-18 02:31:58 +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
|
@ -3,7 +3,6 @@
|
|||
from meshroom.core import desc, pluginManager, loadClassesNodes
|
||||
from meshroom.core.plugins import NodePluginStatus, Plugin
|
||||
|
||||
from itertools import islice
|
||||
import os
|
||||
|
||||
class TestPluginWithValidNodesOnly:
|
||||
|
@ -21,7 +20,8 @@ class TestPluginWithValidNodesOnly:
|
|||
|
||||
@classmethod
|
||||
def teardown_class(cls):
|
||||
pluginManager.unregisterPlugin(cls.plugin)
|
||||
for node in cls.plugin.nodes.values():
|
||||
pluginManager.unregisterNode(node)
|
||||
cls.plugin = None
|
||||
|
||||
def test_loadedPlugin(self):
|
||||
|
@ -127,7 +127,8 @@ class TestPluginWithInvalidNodes:
|
|||
|
||||
@classmethod
|
||||
def teardown_class(cls):
|
||||
pluginManager.unregisterPlugin(cls.plugin)
|
||||
for node in cls.plugin.nodes.values():
|
||||
pluginManager.unregisterNode(node)
|
||||
cls.plugin = None
|
||||
|
||||
def test_loadedPlugin(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue