Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanDeHoop committed Dec 17, 2024
1 parent bd16208 commit 574f2cf
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/everest/test_everserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
from pathlib import Path
from unittest.mock import patch

import yaml
from ropt.enums import OptimizerExitCode
from seba_sqlite.snapshot import SebaSnapshot

from everest.config import EverestConfig, ServerConfig
from everest.config import EverestConfig, OptimizationConfig, ServerConfig
from everest.detached import ServerStatus, everserver_status
from everest.detached.jobs import everserver
from everest.simulator import JOB_FAILURE, JOB_SUCCESS
Expand Down Expand Up @@ -237,7 +236,7 @@ def test_everserver_status_exception(
assert "Exception: Failed optimization" in status["message"]


@patch("sys.argv", ["name", "--config-file", "config.yml"])
@patch("sys.argv", ["name", "--config-file", "config_minimal.yml"])
@patch("everest.detached.jobs.everserver._configure_loggers")
@patch("everest.detached.jobs.everserver._generate_authentication")
@patch(
Expand All @@ -257,13 +256,11 @@ def test_everserver_status_exception(
def test_everserver_status_max_batch_num(
_1, _2, _3, _4, _5, _6, _7, copy_math_func_test_data_to_tmp
):
with open("config_minimal.yml", encoding="utf-8") as file:
config = yaml.safe_load(file)
config["optimization"] = {"algorithm": "optpp_q_newton", "max_batch_num": 1}

with open("config.yml", "w", encoding="utf-8") as fout:
yaml.dump(config, fout)
config = EverestConfig.load_file("config.yml")
config = EverestConfig.load_file("config_minimal.yml")
config.optimization = OptimizationConfig(
algorithm="optpp_q_newton", max_batch_num=1
)
config.dump("config_minimal.yml")

everserver.main()
status = everserver_status(
Expand Down

0 comments on commit 574f2cf

Please sign in to comment.