FEM: unit tests, add some comments

This commit is contained in:
Bernd Hahnebach
2019-03-26 22:04:45 +01:00
committed by wmayer
parent f3c7b7f3b0
commit a918d9e021
6 changed files with 12 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ class TestCcxTools(unittest.TestCase):
fcc_print('import TestCcxTools')
def setUp(self):
# init, is executed before every test
self.doc_name = "TestCcxTools"
try:
FreeCAD.setActiveDocument(self.doc_name)
@@ -772,6 +773,7 @@ class TestCcxTools(unittest.TestCase):
fcc_print('--------------- End of FEM tests FLow 1D thermomech analysis ---------------')
def tearDown(self):
# clearance, is executed after every test
FreeCAD.closeDocument(self.doc_name)
pass

View File

@@ -36,6 +36,7 @@ class TestFemCommon(unittest.TestCase):
fcc_print('import TestFemCommon')
def setUp(self):
# init, is executed before every test
self.doc_name = "TestsFemCommon"
try:
FreeCAD.setActiveDocument(self.doc_name)
@@ -94,5 +95,6 @@ class TestFemCommon(unittest.TestCase):
self.assertTrue(im, 'Problem importing {0}'.format(mod))
def tearDown(self):
# clearance, is executed after every test
FreeCAD.closeDocument(self.doc_name)
pass

View File

@@ -36,6 +36,7 @@ class TestMeshCommon(unittest.TestCase):
fcc_print('import TestMeshCommon')
def setUp(self):
# init, is executed before every test
self.doc_name = "TestMeshCommon"
try:
FreeCAD.setActiveDocument(self.doc_name)
@@ -398,5 +399,6 @@ class TestMeshEleTetra10(unittest.TestCase):
)
def tearDown(self):
# clearance, is executed after every test
FreeCAD.closeDocument(self.doc_name)
pass

View File

@@ -34,6 +34,7 @@ class TestObjectCreate(unittest.TestCase):
fcc_print('import TestObjectCreate')
def setUp(self):
# init, is executed before every test
self.doc_name = "TestObjectCreate"
try:
FreeCAD.setActiveDocument(self.doc_name)
@@ -475,5 +476,6 @@ class TestObjectType(unittest.TestCase):
# is = 43 (just copy in empty file to test)
def tearDown(self):
# clearance, is executed after every test
FreeCAD.closeDocument(self.doc_name)
pass

View File

@@ -35,6 +35,7 @@ class TestResult(unittest.TestCase):
fcc_print('import TestResult')
def setUp(self):
# init, is executed before every test
self.doc_name = "TestResult"
try:
FreeCAD.setActiveDocument(self.doc_name)
@@ -265,5 +266,6 @@ class TestResult(unittest.TestCase):
self.assertEqual(disp_abs, expected_dispabs, "Calculated displacement abs are not the expected values.")
def tearDown(self):
# clearance, is executed after every test
FreeCAD.closeDocument(self.doc_name)
pass

View File

@@ -37,6 +37,7 @@ class TestSolverFrameWork(unittest.TestCase):
fcc_print('import TestSolverFrameWork')
def setUp(self):
# init, is executed before every test
self.doc_name = "TestSolverFrameWork"
try:
FreeCAD.setActiveDocument(self.doc_name)
@@ -199,5 +200,6 @@ class TestSolverFrameWork(unittest.TestCase):
fcc_print('--------------- End of FEM tests solver frame work ---------------')
def tearDown(self):
# clearance, is executed after every test
FreeCAD.closeDocument(self.doc_name)
pass