diff --git a/pioreactor/experiment_profiles/parser.py b/pioreactor/experiment_profiles/parser.py index 1d3c3305..8d7109d2 100644 --- a/pioreactor/experiment_profiles/parser.py +++ b/pioreactor/experiment_profiles/parser.py @@ -249,7 +249,7 @@ def expr(self, p) -> bool | float | str: return convert_string(value) else: - raise MQTTValueError(f"{p.UNIT_JOB_SETTING} does not exist for experiment `{experiment}`") + raise MQTTValueError(f"{data_string} does not exist for experiment `{experiment}`") def parse_profile_expression_to_bool(profile_string: str, env=None) -> bool: diff --git a/pioreactor/tests/test_execute_experiment_profile.py b/pioreactor/tests/test_execute_experiment_profile.py index 1b2eaf1b..3c5f9cd6 100644 --- a/pioreactor/tests/test_execute_experiment_profile.py +++ b/pioreactor/tests/test_execute_experiment_profile.py @@ -11,6 +11,7 @@ from pioreactor.actions.leader.experiment_profile import _verify_experiment_profile from pioreactor.actions.leader.experiment_profile import execute_experiment_profile from pioreactor.actions.leader.experiment_profile import hours_to_seconds +from pioreactor.actions.leader.experiment_profile import seconds_to_hours from pioreactor.background_jobs.stirring import start_stirring from pioreactor.experiment_profiles.profile_struct import _LogOptions from pioreactor.experiment_profiles.profile_struct import CommonBlock @@ -31,13 +32,18 @@ from pioreactor.utils.timing import current_utc_datetime -# First test the hours_to_seconds function def test_hours_to_seconds() -> None: assert hours_to_seconds(1) == 3600 assert hours_to_seconds(0.5) == 1800 assert hours_to_seconds(0) == 0 +def test_seconds_to_hours() -> None: + assert seconds_to_hours(3600.0) == 1 + assert seconds_to_hours(3600) == 1 + assert seconds_to_hours(0) == 0 + + @patch("pioreactor.actions.leader.experiment_profile._load_experiment_profile") def test_execute_experiment_profile_order( mock__load_experiment_profile,