Skip to content

Commit 947a2ea

Browse files
test: add more tests (#109)
1 parent 0204d1d commit 947a2ea

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import pytest
2+
from everest.bin.everest_script import everest_entry
3+
4+
def test_control_sensitivities_simulation(capsys):
5+
"""
6+
Run a basic Drogon control_sensitivities optimization test case.
7+
"""
8+
try:
9+
everest_entry(["data/drogon/control_sensitivities/everest/model/controlsens_experiment.yml", "--skip-prompt"])
10+
except SystemExit as e:
11+
pytest.fail(f"Everest exited with SystemExit: {e}")
12+
13+
captured = capsys.readouterr()
14+
assert "Everest run finished with" in captured.out

tests/drogon/test_well_swap.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from pathlib import Path
2+
import pytest
3+
from everest.bin.everest_script import everest_entry
4+
5+
def test_well_swap_simulation(capsys):
6+
"""
7+
Run a basic Drogon well_swap optimization test case.
8+
"""
9+
10+
config_path = Path("data/drogon/well_swap/everest/model/wellswap_experiment.yml")
11+
config_path.write_text(config_path.read_text().replace('max_batch_num: 10', 'max_batch_num: 2'))
12+
13+
try:
14+
everest_entry([str(config_path), "--skip-prompt"])
15+
except SystemExit as e:
16+
pytest.fail(f"Everest exited with SystemExit: {e}")
17+
18+
captured = capsys.readouterr()
19+
assert "Everest run finished with" in captured.out
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from pathlib import Path
2+
import pytest
3+
from everest.bin.everest_script import everest_entry
4+
5+
def test_well_trajectory_simulation(capsys):
6+
"""
7+
Run a basic Drogon well_trajectory optimization test case.
8+
"""
9+
10+
config_path = Path("data/drogon/well_trajectory/everest/model/welltrajectory_experiment.yml")
11+
config_path.write_text(config_path.read_text().replace('max_batch_num: 10', 'max_batch_num: 2'))
12+
13+
try:
14+
everest_entry([str(config_path), "--skip-prompt"])
15+
except SystemExit as e:
16+
pytest.fail(f"Everest exited with SystemExit: {e}")
17+
18+
captured = capsys.readouterr()
19+
assert "Everest run finished with" in captured.out

0 commit comments

Comments
 (0)