Skip to content

Commit 493f174

Browse files
authored
[Test] Fix test_dump_json test (sofa-framework#488)
* load statecontainer to get MechanicalObject in the factory * fix missing plugin test (grid)
1 parent 60b5b5d commit 493f174

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

bindings/Sofa/tests/Core/ForceField.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def simulate_beam(linear_solver_template):
108108

109109
root.addObject('DefaultAnimationLoop')
110110

111+
root.addObject('RequiredPlugin', name='Sofa.Component.Topology.Container.Grid')
111112
root.addObject('RequiredPlugin', name='Sofa.Component.ODESolver.Backward')
112113
root.addObject('RequiredPlugin', name='Sofa.Component.LinearSolver.Direct')
113114
root.addObject('RequiredPlugin', name='Sofa.Component.Engine.Select')
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import unittest
22
import Sofa
3+
import SofaRuntime
34

45
class Test(unittest.TestCase):
56

67
def test_dump_json(self):
7-
8+
SofaRuntime.importPlugin("Sofa.Component.StateContainer")
89
json = Sofa.Core.ObjectFactory.dump_json()
910
self.assertIn("MechanicalObject", json, "MechanicalObject is not found in the json dump of the ObjectFactory")

0 commit comments

Comments
 (0)