Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/test_invalidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from meshroom.core.graph import Graph
from meshroom.core import desc

from .utils import registerNodeDesc
from .utils import registerNodeDesc, unregisterNodeDesc


class SampleNode(desc.Node):
Expand All @@ -19,10 +19,8 @@ class SampleNode(desc.Node):
]


registerNodeDesc(SampleNode) # register standalone NodePlugin


def test_output_invalidation():
registerNodeDesc(SampleNode) # Register standalone NodePlugin
graph = Graph("")
n1 = graph.addNewNode("SampleNode", input="/tmp")
n2 = graph.addNewNode("SampleNode")
Expand All @@ -48,16 +46,18 @@ def test_output_invalidation():
n1.input.value = "/a/path"
assert n2.input.uid() != n2inputUid # => UID has changed
assert n2.input.uid() == n3.input.uid() # => UIDs on both node are still equal

unregisterNodeDesc(SampleNode)

def test_inputLinkInvalidation():
"""
Input links should not change the invalidation.
"""
registerNodeDesc(SampleNode) # Register standalone NodePlugin
graph = Graph("")
n1 = graph.addNewNode("SampleNode")
n2 = graph.addNewNode("SampleNode")

n1.input.connectTo(n2.input)
assert n1.input.uid() == n2.input.uid()
assert n1.output.value == n2.output.value
unregisterNodeDesc(SampleNode)
4 changes: 3 additions & 1 deletion tests/test_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from meshroom.core.graph import Graph, loadGraph
from meshroom.core.plugins import Plugin

from .utils import registerNodeDesc
from .utils import registerNodeDesc, unregisterNodeDesc


class TestNodeInfo:
Expand All @@ -29,6 +29,7 @@ def setup_class(cls):
def teardown_class(cls):
for node in cls.plugin.nodes.values():
pluginManager.unregisterNode(node)
pluginManager.removePlugin(cls.plugin)
cls.plugin = None

def test_loadedPlugin(self):
Expand All @@ -51,6 +52,7 @@ def test_loadedPlugin(self):
assert nodeInfo["author"] == "testAuthor"
assert nodeInfo["license"] == "no-license"
assert nodeInfo["version"] == "1.0"
unregisterNodeDesc(nodeType)


class TestNodeVariables:
Expand Down
2 changes: 2 additions & 0 deletions tests/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def setup_class(cls):
def teardown_class(cls):
for node in cls.plugin.nodes.values():
pluginManager.unregisterNode(node)
pluginManager.removePlugin(cls.plugin)
cls.plugin = None

def test_loadedPlugin(self):
Expand Down Expand Up @@ -133,6 +134,7 @@ def setup_class(cls):
def teardown_class(cls):
for node in cls.plugin.nodes.values():
pluginManager.unregisterNode(node)
pluginManager.removePlugin(cls.plugin)
cls.plugin = None

def test_loadedPlugin(self):
Expand Down
1 change: 1 addition & 0 deletions tests/test_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def setup_class(cls):
def teardown_class(cls):
for node in cls.plugin.nodes.values():
pluginManager.unregisterNode(node)
pluginManager.removePlugin(cls.plugin)
cls.plugin = None

def setupNode(self, graph, name):
Expand Down
Loading