def test_run_optimization_with_nonexisting_input_file_fails(nonexisting_input_file, output_file): assert not Path(nonexisting_input_file).exists() cli_args = [ '--load', nonexisting_input_file, '--run', 'opt', '--out', output_file, ] with pytest.raises(SystemExit, match='10'): foqus.main(cli_args)
def test_run_optimization_with_existing_input_file_succeeds(input_file, output_file): assert Path(input_file).exists() cli_args = [ '--load', input_file, '--run', 'opt', '--out', output_file, ] with pytest.raises(SystemExit, match='0'): foqus.main(cli_args) assert Path(output_file).exists()
def test_run_optimization_with_nonexisting_input_file_fails( nonexisting_input_file, output_file): assert not Path(nonexisting_input_file).exists() cli_args = [ "--load", nonexisting_input_file, "--run", "opt", "--out", output_file, ] with pytest.raises(SystemExit, match="10"): foqus.main(cli_args)
def test_run_optimization_with_existing_input_file_succeeds( input_file, output_file): assert Path(input_file).exists() cli_args = [ "--load", input_file, "--run", "opt", "--out", output_file, ] with pytest.raises(SystemExit, match="0"): foqus.main(cli_args) assert Path(output_file).exists()
def test_start_gui(): cli_args = [] with pytest.raises(SystemExit, match="0"): foqus.main(cli_args)