FEM: code formating, max line length in unit test module
This commit is contained in:
@@ -51,9 +51,11 @@ False if TestSolverFrameWork.__name__ else True
|
||||
|
||||
|
||||
# For more information on how to run a specific test class or a test method see
|
||||
# file src/Mod/Test/__init__ and forum https://forum.freecadweb.org/viewtopic.php?f=10&t=22190#p175546
|
||||
# file src/Mod/Test/__init__
|
||||
# forum https://forum.freecadweb.org/viewtopic.php?f=10&t=22190#p175546
|
||||
|
||||
# It may be useful to temporary comment FreeCAD.closeDocument(self.doc_name) in tearDown method to not close the document
|
||||
# It may be useful to temporary comment FreeCAD.closeDocument(self.doc_name)
|
||||
# in tearDown method to not close the document
|
||||
|
||||
|
||||
'''
|
||||
@@ -72,8 +74,9 @@ Test.runTestsFromClass(femtest.testcommon.TestFemCommon)
|
||||
|
||||
# method
|
||||
import unittest
|
||||
mytest = unittest.TestLoader().loadTestsFromName("femtest.testcommon.TestFemCommon.test_pyimport_all_FEM_modules")
|
||||
unittest.TextTestRunner().run(mytest)
|
||||
thetest = "femtest.testcommon.TestFemCommon.test_pyimport_all_FEM_modules"
|
||||
alltest = unittest.TestLoader().loadTestsFromName(thetest)
|
||||
unittest.TextTestRunner().run(alltest)
|
||||
|
||||
|
||||
# examples from shell in build dir:
|
||||
@@ -108,7 +111,8 @@ unittest.TextTestRunner().run(mytest)
|
||||
./bin/FreeCAD --run-test "femtest.testcommon.TestFemCommon.test_pyimport_all_FEM_modules"
|
||||
|
||||
# unit test command to run a specific FEM unit test to copy for fast tests :-)
|
||||
# to get all command to start FreeCAD from build dir on Linux and run FEM unit test this could be used
|
||||
# to get all commands to start FreeCAD from build dir on Linux
|
||||
# and run FEM unit test this could be used:
|
||||
from femtest.utilstest import get_fem_test_defs as gf
|
||||
gf()
|
||||
|
||||
@@ -145,7 +149,8 @@ gf()
|
||||
./bin/FreeCADCmd --run-test "femtest.testsolverframework.TestSolverFrameWork.test_solver_framework"
|
||||
|
||||
|
||||
# to get all command to start FreeCAD from build dir on Linux and run FEM unit test this could be used
|
||||
# to get all command to start FreeCAD from build dir on Linux
|
||||
# and run FEM unit test this could be used:
|
||||
from femtest.utilstest import get_fem_test_defs as gf
|
||||
gf('in')
|
||||
|
||||
@@ -246,12 +251,13 @@ unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromName("femtest.t
|
||||
# open files from FEM test suite source code
|
||||
# be careful on updating these files, they contain the original results!
|
||||
# TODO update files, because some of them have non-existing FEM object classes
|
||||
doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'Mod/Fem/femtest/testfiles/ccx/cube.FCStd')
|
||||
doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'Mod/Fem/femtest/testfiles/ccx/cube_frequency.FCStd')
|
||||
doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'Mod/Fem/femtest/testfiles/ccx/cube_static.FCStd')
|
||||
doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech.FCStd')
|
||||
doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'Mod/Fem/femtest/testfiles/ccx/multimat.FCStd')
|
||||
doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'Mod/Fem/femtest/testfiles/ccx/spine_thermomech.FCStd')
|
||||
app_home = FreeCAD.ConfigGet("AppHomePath")
|
||||
doc = FreeCAD.open(app_home + 'Mod/Fem/femtest/testfiles/ccx/cube.FCStd')
|
||||
doc = FreeCAD.open(app_home + 'Mod/Fem/femtest/testfiles/ccx/cube_frequency.FCStd')
|
||||
doc = FreeCAD.open(app_home + 'Mod/Fem/femtest/testfiles/ccx/cube_static.FCStd')
|
||||
doc = FreeCAD.open(app_home + 'Mod/Fem/femtest/testfiles/ccx/Flow1D_thermomech.FCStd')
|
||||
doc = FreeCAD.open(app_home + 'Mod/Fem/femtest/testfiles/ccx/multimat.FCStd')
|
||||
doc = FreeCAD.open(app_home + 'Mod/Fem/femtest/testfiles/ccx/spine_thermomech.FCStd')
|
||||
|
||||
# open files generated from test suite
|
||||
import femtest.utilstest as ut
|
||||
@@ -264,10 +270,11 @@ doc = ut.multimat()
|
||||
doc = ut.spine_thermomech()
|
||||
|
||||
# load std FEM example files
|
||||
doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'data/examples/FemCalculixCantilever2D.FCStd')
|
||||
doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'data/examples/FemCalculixCantilever3D.FCStd')
|
||||
doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'data/examples/FemCalculixCantilever3D_newSolver.FCStd')
|
||||
doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'data/examples/Fem.FCStd')
|
||||
doc = FreeCAD.open(FreeCAD.ConfigGet("AppHomePath") + 'data/examples/Fem2.FCStd')
|
||||
app_home = FreeCAD.ConfigGet("AppHomePath")
|
||||
doc = FreeCAD.open(app_home + 'data/examples/FemCalculixCantilever2D.FCStd')
|
||||
doc = FreeCAD.open(app_home + 'data/examples/FemCalculixCantilever3D.FCStd')
|
||||
doc = FreeCAD.open(app_home + 'data/examples/FemCalculixCantilever3D_newSolver.FCStd')
|
||||
doc = FreeCAD.open(app_home + 'data/examples/Fem.FCStd')
|
||||
doc = FreeCAD.open(app_home + 'data/examples/Fem2.FCStd')
|
||||
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user