FEM: elmer writer, fix unit test
This commit is contained in:
@@ -55,10 +55,23 @@ class TestSolverFrameWork(unittest.TestCase):
|
||||
"FEM_solverframework"
|
||||
)
|
||||
|
||||
# make sure std FreeCAD unit system mm/kg/s is used
|
||||
param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units")
|
||||
self.unit_schema = param.GetInt("UserSchema")
|
||||
if self.unit_schema != 0:
|
||||
fcc_print("Unit schema: {}. Set unit schema to 0 (mm/kg/s)".format(self.unit_schema))
|
||||
param.SetInt("UserSchema", 0)
|
||||
|
||||
# ********************************************************************************************
|
||||
def tearDown(
|
||||
self
|
||||
):
|
||||
# set back unit unit schema
|
||||
if self.unit_schema != 0:
|
||||
fcc_print("Set unit schema back to {}".format(self.unit_schema))
|
||||
param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Units")
|
||||
param.SetInt("UserSchema", self.unit_schema)
|
||||
|
||||
# tearDown is executed after every test
|
||||
FreeCAD.closeDocument(self.document.Name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user