File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 88
99import meshroom .core
1010from meshroom .core import desc , registerNodeType , unregisterNodeType
11- from meshroom .core .exception import NodeUpgradeError
11+ from meshroom .core .exception import GraphCompatibilityError , NodeUpgradeError
1212from meshroom .core .graph import Graph , loadGraph
1313from 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+
You can’t perform that action at this time.
0 commit comments