def shutdown_environment_only_core(caplog=None, expected_warnings=0, expected_errors=0): from rafcon.core.singleton import state_machine_manager # in the gui case, the state machines have to be deleted while the gui is still running with add_gui_callback # if add_gui_callback is not used, then a multi threading RuntimeError will be raised by the PatchedModelMT state_machine_manager.delete_all_state_machines() shutdown_environment(caplog, expected_warnings, expected_errors, unpatch_threading=False, core_only=True)
def test_runtime_values(caplog): state_machine_manager.delete_all_state_machines() sm = state_machine_execution_engine.execute_state_machine_from_path( path=testing_utils.get_test_sm_path(os.path.join("unit_test_state_machines", "library_runtime_value_test"))) state_machine_manager.remove_state_machine(sm.state_machine_id) assert sm.root_state.output_data["data_output_port1"] == 114 testing_utils.assert_logger_warnings_and_errors(caplog)
def test_start(): """ Test core.start.py script run on console which open a state machine, run it and final checks the output file on consistency. """ start_path = testing_utils.get_test_sm_path( join("unit_test_state_machines", "start_script_test")) args = (['-o', start_path, '-c', testing_utils.RAFCON_TEMP_PATH_CONFIGS]) start.main(optional_args=args) start.signal_handler(signal.SIGINT) state_machine_manager.delete_all_state_machines()