From 419c2f597ebb4bd5d5b26d3f93bd2c1709fc3370 Mon Sep 17 00:00:00 2001 From: madsmpedersen <m@madsp.dk> Date: Thu, 14 Apr 2016 15:48:21 +0200 Subject: [PATCH] test fail fixes --- wetb/hawc2/htc_file.py | 6 +++--- wetb/hawc2/tests/test_htc_file.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/wetb/hawc2/htc_file.py b/wetb/hawc2/htc_file.py index 84492c8..10eb514 100644 --- a/wetb/hawc2/htc_file.py +++ b/wetb/hawc2/htc_file.py @@ -104,10 +104,10 @@ class HTCFile(HTCContents, HTCDefaults): fid.write(str(self)) def set_name(self, name, folder="htc/"): - if os.path.isabs(folder) is False and os.path.relpath(folder).startswith("htc" + os.path.sep): - folder = "./" + os.path.relpath(folder).replace("\\", "/") + #if os.path.isabs(folder) is False and os.path.relpath(folder).startswith("htc" + os.path.sep): + folder = "./" + os.path.relpath(folder).replace("\\", "/") - self.filename = os.path.join(self.modelpath, folder, "%s.htc" % name).replace("\\", "/") + self.filename = os.path.relpath(os.path.join(self.modelpath, folder, "%s.htc" % name)).replace("\\", "/") if 'simulation' in self and 'logfile' in self.simulation: self.simulation.logfile = os.path.join(folder.replace("htc", "log", 1), "%s.log" % name).replace("\\", "/") elif 'test_structure' in self and 'logfile' in self.test_structure: diff --git a/wetb/hawc2/tests/test_htc_file.py b/wetb/hawc2/tests/test_htc_file.py index ba878df..f0ecc3d 100644 --- a/wetb/hawc2/tests/test_htc_file.py +++ b/wetb/hawc2/tests/test_htc_file.py @@ -118,9 +118,9 @@ class TestHtcFile(unittest.TestCase): htcfile.add_mann_turbulence(30.1, 1.1, 3.3, 102, False) s = """begin mann; create_turb_parameters\t30.1 1.1 3.3 102 0;\tL, alfaeps, gamma, seed, highfrq compensation - filename_u\t./turb/turb_wsp10_s0102u.bin; - filename_v\t./turb/turb_wsp10_s0102v.bin; - filename_w\t./turb/turb_wsp10_s0102w.bin; + filename_u\t./turb/l30.1_ae1.10_g3.3_h0_4096x32x32_1.465x3.12x3.12_s0102u.turb; + filename_v\t./turb/l30.1_ae1.10_g3.3_h0_4096x32x32_1.465x3.12x3.12_s0102v.turb; + filename_w\t./turb/l30.1_ae1.10_g3.3_h0_4096x32x32_1.465x3.12x3.12_s0102w.turb; box_dim_u\t4096 1.4652; box_dim_v\t32 3.2258; box_dim_w\t32 3.2258; @@ -212,7 +212,7 @@ class TestHtcFile(unittest.TestCase): self.assertIn(os.path.abspath(self.testfilepath + 'orientation.dat'), [os.path.abspath(f) for f in htcfile.input_files()]) self.assertIn('./data/NREL_5MW_st1.txt', htcfile.input_files()) self.assertEqual(str(htcfile).count("exit"), 1) - self.assertIn('filename\t./res/oc4_p2_Load_case_eq;', str(htcfile)) + self.assertIn('filename\t./res/oc4_p2_load_case_eq;', str(htcfile)) def test_tjul_example(self): htcfile = HTCFile(self.testfilepath + "./tjul.htc", ".") -- GitLab