From dee8809454f495ed356f333738ae8f64d1d997c2 Mon Sep 17 00:00:00 2001 From: Przemo Firszt Date: Mon, 16 Nov 2015 18:07:14 +0000 Subject: [PATCH] FEM, Tests: Force unix line ends for comparing calculation stats Signed-off-by: Przemo Firszt --- src/Mod/Fem/TestFem.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mod/Fem/TestFem.py b/src/Mod/Fem/TestFem.py index f53b3faff..74488e43b 100644 --- a/src/Mod/Fem/TestFem.py +++ b/src/Mod/Fem/TestFem.py @@ -134,15 +134,21 @@ class FemTest(unittest.TestCase): return result def compare_stats(self, fea, stat_file=None): + sf_content_normalised = [] if stat_file: sf = open(stat_file, 'r') sf_content = sf.readlines() sf.close() + # Force \n line ends + for line in sf_content: + if line.endswith("\r\n"): + line = line[:-2] + '\n' + sf_content_normalised.append(line) stat_types = ["U1", "U2", "U3", "Uabs", "Sabs"] stats = [] for s in stat_types: stats.append("{}: {}\n".format(s, fea.get_stats(s))) - if sf_content != stats: + if sf_content_normalised != stats: fcc_print("Expected stats from {}".format(stat_file)) fcc_print(sf_content) fcc_print("Stats read from {}.frd file".format(fea.base_name))