diff --git a/binarycpython/tests/test_grid.py b/binarycpython/tests/test_grid.py index ff44027ae77aebe60f9bb38a656fceb4e3103171..5290067efc80849b07f7a6c9f82113ba1617d293 100644 --- a/binarycpython/tests/test_grid.py +++ b/binarycpython/tests/test_grid.py @@ -14,6 +14,7 @@ import datetime from binarycpython.utils.grid import Population from binarycpython.utils.functions import temp_dir +from binarycpython.utils.custom_logging_functions import binary_c_log_code binary_c_temp_dir = temp_dir() @@ -350,6 +351,39 @@ class test_Population(unittest.TestCase): self.assertTrue(argdict["M_1"] == 10) self.assertTrue(argdict["metallicity"] == 0.02) + def test_evolve_single(self): + """ + Unittests for the function evolve_single + """ + + CUSTOM_LOGGING_STRING_MASSES = """ + Printf("MASS_PLOTTING %30.12e %g %g %g %g\\n", + // + stardata->model.time, // 1 + + // masses + stardata->common.zero_age.mass[0], // + stardata->common.zero_age.mass[1], // + + stardata->star[0].mass, + stardata->star[1].mass + ); + """ + + test_pop = Population() + test_pop.set(M_1=10, M_2=5, orbital_period=100000, metallicty=0.02, max_evolution_time = 15000) + + custom_logging_code = binary_c_log_code( + CUSTOM_LOGGING_STRING_MASSES + ) + test_pop.set(custom_logging_code=custom_logging_code) + + output = test_pop.evolve_single() + + print(output) + + + if __name__ == "__main__": unittest.main()