Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Sep 16, 2023
1 parent bc731e5 commit e54574c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions pioreactor/actions/leader/experiment_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ def load_and_verify_profile_file(profile_filename: str) -> struct.Profile:
# 1.
def check_for_not_stopping_automations(act):
if act.type == "stop":
raise ValueError("Don't use 'stop' for automations. Use 'stop' for controllers.")
raise ValueError(
"Don't use 'stop' for automations. To stop automations, use 'stop' for controllers."
)
return True

for automation_type in ["temperature_automation", "dosing_automation", "led_automation"]:
Expand Down Expand Up @@ -207,7 +209,11 @@ def execute_experiment_profile(profile_filename: str, dry_run: bool = False) ->
action_name = "experiment_profile"
logger = create_logger(action_name)
with publish_ready_to_disconnected_state(unit, experiment, action_name) as state:
profile = load_and_verify_profile_file(profile_filename)
try:
profile = load_and_verify_profile_file(profile_filename)
except Exception as e:
logger.error(e)
raise e

publish(
f"pioreactor/{unit}/{experiment}/{action_name}/experiment_profile_name",
Expand Down
2 changes: 1 addition & 1 deletion pioreactor/automations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ def execute(self) -> Optional[events.AutomationEvent]:
"""
Overwrite in subclass
"""
return None
return events.NoEvent()

0 comments on commit e54574c

Please sign in to comment.