Skip to content

Commit

Permalink
FEM: code formating, max line length in unit test module
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Jun 30, 2019
1 parent 1a67ec6 commit fe91c44
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions src/Mod/Fem/TestFem.py
Expand Up @@ -51,9 +51,11 @@


# 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


'''
Expand All @@ -72,8 +74,9 @@
# 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:
Expand Down Expand Up @@ -108,7 +111,8 @@
./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()
Expand Down Expand Up @@ -145,7 +149,8 @@
./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')
Expand Down Expand Up @@ -246,12 +251,13 @@
# 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
Expand All @@ -264,10 +270,11 @@
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')
'''

0 comments on commit fe91c44

Please sign in to comment.