def test_when_run_on_an_empty_directory_the_tree_structure_is_initialised( self, ): input_arguments = self.parser.parse_args([]) main.run_with(input_arguments, self.main_parameters) assert self.studies_in_path.is_dir() assert self.finished_path.is_dir() assert self.log_path.is_dir() assert self.json_db_file_path.is_file()
def test_when_run_on_an_empty_directory_the_tree_structure_is_initialised( self): arg_ssh_config = [ "--ssh-settings-file", f"{str(self.ssh_config_file_path)}" ] input_arguments = self.parser.parse_args(arg_ssh_config) main.run_with(input_arguments) assert self.studies_in_path.is_dir() assert self.finished_path.is_dir() assert self.log_path.is_dir() assert self.json_db_file_path.is_file()
def test_one_study_is_correctly_processed(self): arg_wait_mode = ["-w"] arg_wait_time = ["--wait-time", "2"] arg_2_cpu = ["-n", "2"] arg_studies_in = ["-i", f"{str(EXAMPLE_STUDIES_IN)}"] arguments = arg_wait_mode + arg_wait_time + arg_2_cpu + arg_studies_in input_arguments = self.parser.parse_args(arguments) main.run_with(input_arguments, self.main_parameters) assert not is_empty(self.finished_path / ANTARES_STUDY.name) assert not is_empty(self.finished_path / ANTARES_STUDY.name / "output")
def test_one_study_is_correctly_processed(self): arg_ssh_config = [ "--ssh-settings-file", f"{str(self.ssh_config_file_path)}" ] arg_wait_mode = ["-w"] arg_wait_time = ["--wait-time", "2"] arg_2_cpu = ["-n", "2"] arg_studies_in = ["-i", f"{str(EXAMPLE_STUDIES_IN)}"] arguments = (arg_ssh_config + arg_wait_mode + arg_wait_time + arg_2_cpu + arg_studies_in) input_arguments = self.parser.parse_args(arguments) main.run_with(input_arguments) assert not is_empty(self.finished_path / ANTARES_STUDY.name) assert not is_empty(self.finished_path / ANTARES_STUDY.name / "output")
import sys from pathlib import Path from antareslauncher.main import run_with, MainParameters from antareslauncher.main_option_parser import ( MainOptionParser, ParserParameters, ) from antareslauncher.parameters_reader import ParametersReader DATA_DIR = Path(__file__).parent.resolve() / "data" SSH_JSON_FILE = DATA_DIR / "sshconfig.json" YAML_CONF_FILE = DATA_DIR / "configuration.yaml" if __name__ == "__main__": param_reader = ParametersReader(json_ssh_conf=SSH_JSON_FILE, yaml_filepath=YAML_CONF_FILE) parser_parameters: ParserParameters = param_reader.get_parser_parameters() parser: MainOptionParser = MainOptionParser(parser_parameters) parser.add_basic_arguments() arguments = parser.parse_args() main_parameters: MainParameters = param_reader.get_main_parameters() run_with(arguments=arguments, parameters=main_parameters, show_banner=True) if not len(sys.argv) > 1: input("Press ENTER to exit.")
import sys from antareslauncher.main import run_with from antareslauncher.main_option_parser import MainOptionParser if __name__ == "__main__": parser: MainOptionParser = MainOptionParser() parser.add_basic_arguments() parser.add_advanced_arguments() arguments = parser.parse_args() run_with(arguments) if not len(sys.argv) > 1: input("Press ENTER to exit.")
import sys from antareslauncher import main from antareslauncher.main_option_parser import MainOptionParser if __name__ == "__main__": parser: MainOptionParser = MainOptionParser() parser.add_basic_arguments() input_arguments = parser.parse_args() main.run_with(input_arguments) if not len(sys.argv) > 1: input("Press ENTER to exit.")