From 706b812bd59f22cc4669bb88c71da0a37ccaf20c Mon Sep 17 00:00:00 2001 From: DhruvSondhi Date: Tue, 15 Jun 2021 11:42:31 +0530 Subject: [PATCH] Adding barebone structure for testing check_simulation_env() --- tardis/tests/test_util.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/tardis/tests/test_util.py b/tardis/tests/test_util.py index 9fa47d19c40..ce05b236965 100644 --- a/tardis/tests/test_util.py +++ b/tardis/tests/test_util.py @@ -4,6 +4,7 @@ import os from astropy import units as u from io import StringIO +from IPython import get_ipython from tardis.util.base import ( MalformedSpeciesError, @@ -22,6 +23,7 @@ reformat_element_symbol, quantity_linspace, convert_abundances_format, + check_simulation_env, ) data_path = os.path.join("tardis", "io", "tests", "data") @@ -149,11 +151,7 @@ def test_species_tuple_to_string(species_tuple, roman_numerals, species_string): @pytest.mark.parametrize( ["species_string", "species_tuple"], - [ - ("si ii", (14, 1)), - ("si 2", (14, 1)), - ("si ix", (14, 8)), - ], + [("si ii", (14, 1)), ("si 2", (14, 1)), ("si ix", (14, 8)),], ) def test_species_string_to_tuple(species_string, species_tuple): assert species_string_to_tuple(species_string) == species_tuple @@ -202,13 +200,7 @@ def test_atomic_number2element_symbol(): @pytest.mark.parametrize( ["unformatted_element_string", "formatted_element_string"], - [ - ("si", "Si"), - ("sI", "Si"), - ("Si", "Si"), - ("c", "C"), - ("C", "C"), - ], + [("si", "Si"), ("sI", "Si"), ("Si", "Si"), ("c", "C"), ("C", "C"),], ) def test_reformat_element_symbol( unformatted_element_string, formatted_element_string @@ -251,3 +243,16 @@ def test_convert_abundances_format(artis_abundances_fname): assert np.isclose(abundances.loc[1, "Co"], 2.306023e-05, atol=1.0e-12) assert np.isclose(abundances.loc[69, "Ni"], 1.029928e-17, atol=1.0e-12) assert np.isclose(abundances.loc[2, "C"], 4.425876e-09, atol=1.0e-12) + + +# @pytest.mark.parametrize( +# "test_shell_config, expected_value", +# [ +# ("ZMQInteractiveShell", True), +# ("TerminalInteractiveShell", False), +# ("something", False), +# ], +# ) +# def test_check_simulation_env(test_shell_config, expected_value): +def test_check_simulation_env(): + assert check_simulation_env() == False