@@ -155,15 +155,34 @@ def test_default_installed_jobs(tmp_path, monkeypatch):
155155@pytest .mark .filterwarnings (
156156 "ignore:Config contains a SUMMARY key but no forward model steps"
157157)
158- def test_combined_wells_everest_to_ert (tmp_path , monkeypatch ):
158+ @pytest .mark .parametrize (
159+ "config_yaml" ,
160+ [
161+ dedent ("""
162+ wells: [{ name: fakename}]
163+ """ ),
164+ dedent ("""
165+ controls:
166+ - name: default_group
167+ type: well_control
168+ initial_guess: 0.5
169+ perturbation_magnitude: 0.01
170+ variables:
171+ - name: fakename
172+ min: 0
173+ max: 1
174+ """ ),
175+ ],
176+ )
177+ def test_combined_wells_everest_to_ert (tmp_path , monkeypatch , config_yaml ):
159178 monkeypatch .chdir (tmp_path )
160179 Path ("my_file" ).touch ()
161180 Path ("my_executable" ).touch (mode = stat .S_IEXEC )
162181 ever_config = EverestConfig .with_defaults (
163182 ** yaml .safe_load (
164- dedent ("""
183+ config_yaml
184+ + dedent ("""
165185 model: {"realizations": [0]}
166- wells: [{ name: fakename}]
167186 definitions: {eclbase: my_test_case}
168187 install_jobs:
169188 - name: nothing
@@ -220,9 +239,22 @@ def test_install_data_no_init(tmp_path, source, target, symlink, cmd, monkeypatc
220239
221240@pytest .mark .integration_test
222241@pytest .mark .skip_mac_ci
223- def test_summary_default_no_opm (tmp_path , monkeypatch ):
242+ @pytest .mark .parametrize ("wells_config" , [None , [{"name" : "default_name" }]])
243+ def test_summary_default_no_opm (tmp_path , monkeypatch , wells_config ):
224244 monkeypatch .chdir (tmp_path )
225245 everconf = EverestConfig .with_defaults (
246+ wells = wells_config ,
247+ controls = [
248+ {
249+ "name" : "default_group" ,
250+ "type" : "well_control" ,
251+ "initial_guess" : 0.5 ,
252+ "perturbation_magnitude" : 0.01 ,
253+ "variables" : [
254+ {"name" : "default_name" , "min" : 0 , "max" : 1 },
255+ ],
256+ }
257+ ],
226258 forward_model = [
227259 {
228260 "job" : "eclipse100 eclipse/model/EgG.DATA --version 2020.2" ,
@@ -232,10 +264,19 @@ def test_summary_default_no_opm(tmp_path, monkeypatch):
232264 "keys" : ["*" ],
233265 },
234266 }
235- ]
267+ ],
236268 )
237269 # Read wells from the config instead of using opm
238- wells = [w .name for w in everconf .wells ]
270+ wells = (
271+ [
272+ variable .name
273+ for control in everconf .controls
274+ for variable in control .variables
275+ if control .type == "well_control"
276+ ]
277+ if wells_config is None
278+ else [w .name for w in everconf .wells ]
279+ )
239280 sum_keys = (
240281 list (everest .simulator .DEFAULT_DATA_SUMMARY_KEYS )
241282 + list (everest .simulator .DEFAULT_FIELD_SUMMARY_KEYS )
@@ -714,7 +755,7 @@ def test_that_summary_keys_default_to_expected_keys_according_to_wells(
714755 min_config ["controls" ] = [
715756 {
716757 "name" : "well_rate" ,
717- "type" : "generic_control " ,
758+ "type" : "well_control " ,
718759 "perturbation_magnitude" : 0.01 ,
719760 "variables" : [
720761 {
0 commit comments