Exemple #1
0
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)
Exemple #2
0
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()
Exemple #3
0
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)
Exemple #4
0
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()
Exemple #5
0
def test_start_gui():
    cli_args = []
    with pytest.raises(SystemExit, match="0"):
        foqus.main(cli_args)