From 5f5638ae8d53969bd0a6bb9b324e28444a488bc6 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Fri, 17 Jan 2020 08:01:03 +0100 Subject: [PATCH] FEM: unit tests, improve ccx tests --- src/Mod/Fem/femtest/app/test_ccxtools.py | 27 +++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/Mod/Fem/femtest/app/test_ccxtools.py b/src/Mod/Fem/femtest/app/test_ccxtools.py index aae660ceb4..337a6e8a8b 100644 --- a/src/Mod/Fem/femtest/app/test_ccxtools.py +++ b/src/Mod/Fem/femtest/app/test_ccxtools.py @@ -549,10 +549,24 @@ class TestCcxTools(unittest.TestCase): def test_6_contact_shell_shell( self ): - test_name = "contact shell shell analysis test" - base_name = "contact_shell_shell" - test_dir = "FEM_ccx_contact_shell_shell" + # set up the example + from femexamples import contact_shell_shell as shellcontact + shellcontact.setup(self.active_doc, "ccxtools") + # test input file writing + self.input_file_writing_test( + test_name="contact shell shell analysis test", + base_name="contact_shell_shell", + test_dir="FEM_ccx_contact_shell_shell", + ) + + # ******************************************************************************************** + def input_file_writing_test( + self, + test_name, + base_name, + test_dir + ): fcc_print( "\n--------------- " "Start of FEM ccxtools {}" @@ -560,13 +574,6 @@ class TestCcxTools(unittest.TestCase): .format(test_name) ) - # set up the example - from femexamples import contact_shell_shell as shellcontact - shellcontact.setup(self.active_doc, "ccxtools") - - # code from here is independent, TODO put in separate def - # adding more inp file tests would be very simple ... - # set up analysis analysis = self.active_doc.Analysis solver_object = self.active_doc.CalculiXccxTools analysis_dir = testtools.get_unit_test_tmp_dir(