Commit 498a5ca 1 parent f5326ee commit 498a5ca Copy full SHA for 498a5ca
File tree 1 file changed +14
-7
lines changed
tests/test_config_parsing
1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,20 @@ def test_default_model_config_ens_path(tmpdir):
45
45
46
46
47
47
def test_default_model_config_run_path (tmpdir ):
48
- assert (
49
- ModelConfig (
50
- num_realizations = 1 ,
51
- ).runpath_format_string
52
- == "simulations/realization-%d/iter-%d"
53
- )
54
-
48
+ mc = ModelConfig (num_realizations = 1 )
49
+ assert mc .runpath_format_string == "simulations/realization-<IENS>/iter-<ITER>"
50
+ assert mc .is_valid_runpath () == True
51
+
52
+ def test_invalid_model_config_run_path (tmpdir ):
53
+ mc = ModelConfig (num_realizations = 1 , runpath_format_string = "realization-no-specifier" )
54
+ assert mc .runpath_format_string == None
55
+ assert mc .is_valid_runpath () == False
56
+
57
+ def test_deprecated_model_config_run_path (tmpdir ):
58
+ runpath = "simulations/realization-%d/iter-%d"
59
+ mc = ModelConfig (num_realizations = 1 , runpath_format_string = runpath )
60
+ assert mc .runpath_format_string == runpath
61
+ assert mc .is_valid_runpath () == True
55
62
56
63
@given (config_generators ())
57
64
def test_model_config_from_dict_and_user_config (tmp_path_factory , config_generator ):
You can’t perform that action at this time.
0 commit comments