Skip to content

Commit 87e538c

Browse files
committed
[tests] Add strictCompatibility graph loading test
1 parent bbdf2d2 commit 87e538c

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

tests/test_compatibility.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import meshroom.core
1010
from meshroom.core import desc, registerNodeType, unregisterNodeType
11-
from meshroom.core.exception import NodeUpgradeError
11+
from meshroom.core.exception import GraphCompatibilityError, NodeUpgradeError
1212
from meshroom.core.graph import Graph, loadGraph
1313
from meshroom.core.node import CompatibilityNode, CompatibilityIssue, Node
1414

@@ -395,3 +395,24 @@ def test_conformUpgrade():
395395

396396
unregisterNodeType(SampleNodeV5)
397397
unregisterNodeType(SampleNodeV6)
398+
399+
400+
class TestGraphLoadingWithStrictCompatibility:
401+
402+
def test_failsOnNodeDescriptionCompatibilityIssue(self, graphSavedOnDisk):
403+
registerNodeType(SampleNodeV1)
404+
registerNodeType(SampleNodeV2)
405+
406+
graph: Graph = graphSavedOnDisk
407+
graph.addNewNode(SampleNodeV1.__name__)
408+
graph.save()
409+
410+
# Replace saved node description by V2
411+
meshroom.core.nodesDesc[SampleNodeV1.__name__] = SampleNodeV2
412+
413+
with pytest.raises(GraphCompatibilityError):
414+
loadGraph(graph.filepath, strictCompatibility=True)
415+
416+
unregisterNodeType(SampleNodeV1)
417+
unregisterNodeType(SampleNodeV2)
418+

0 commit comments

Comments
 (0)