unittests_run_hierarchies

import unittest
from os import sep
from pct.putils import Timer
from pct.hierarchy import PCTHierarchy
from pct.environment_processing import EnvironmentProcessingFactory
class TestRunWindTurbine(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        pass

    def test_run_s_0538_03(self):

        # file = "testfiles" + sep + "data" + sep + "ga" + sep + "WindTurbine"+sep+"ga--1362.401-s003-4x3-m005-WT0538-bddf277b0f729cc630efacf91b9f494f.properties"
        file = "testfiles" + sep +  "WindTurbine"+sep+"ga--1362.401-s003-4x3-m005-WT0538-bddf277b0f729cc630efacf91b9f494f.properties"
        timer = Timer()
        timer.start()
        _, score = PCTHierarchy.run_from_file(file, env_props=None, seed=1, render=False, move=None, min=True, history=False, 
                                                    hpct_verbose= False, runs=None, plots_dir=None, early_termination=False)
        print(f'Score={score:0.3f}')
        timer.stop()
        print(f'Mean time: {timer.mean()}')

        self.assertAlmostEqual(score, -1362.401471117955 )

    def test_run_v_0416_01(self):

        # file = "testfiles" + sep + "data" + sep + "ga" + sep + "WindTurbine"+sep+ "ga--2629.009-s001-5x5-m002-WT0416-31ecb19201d49e8c6f9dd1e172bd6944.properties"
        file = "testfiles" + sep  + "WindTurbine"+sep+ "ga--2629.009-s001-5x5-m002-WT0416-31ecb19201d49e8c6f9dd1e172bd6944.properties"
        timer = Timer()
        timer.start()
        _, score = PCTHierarchy.run_from_file(file, env_props=None, seed=1, render=False, move=None, min=True, history=False, 
                                                    hpct_verbose= False, runs=None, plots_dir=None, early_termination=False)
        print(f'Score={score:0.3f}')
        timer.stop()
        print(f'Mean time: {timer.mean()}')

        self.assertAlmostEqual(score, -2629.008509888531 )
res = unittest.main(argv=[''], verbosity=3, exit=False)
test_run_s_0538_03 (__main__.TestRunWindTurbine) ... ok
test_run_v_0416_01 (__main__.TestRunWindTurbine) ... 
Score=-1362.401
Mean time: 1.1514172999999914
ok

----------------------------------------------------------------------
Ran 2 tests in 1.557s

OK
Score=-2629.009
Mean time: 0.4034749000000062
assert len(res.result.failures) == 0
assert len(res.result.errors) == 0