Skip to content

Commit

Permalink
Add back commit
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Sep 30, 2024
1 parent 138faf4 commit 9a0fd2c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ert/config/design_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
@dataclass
class DesignMatrix:
xls_filename: Path
designsheet: str
defaultsheet: str
design_sheet: str
default_sheet: str

@classmethod
def from_config_list(cls, config_list: List[str]) -> "DesignMatrix":
Expand Down Expand Up @@ -47,6 +47,6 @@ def from_config_list(cls, config_list: List[str]) -> "DesignMatrix":
assert default_sheet is not None
return cls(
xls_filename=filename,
designsheet=design_sheet,
defaultsheet=default_sheet,
design_sheet=design_sheet,
default_sheet=default_sheet,
)
26 changes: 26 additions & 0 deletions tests/ert/unit_tests/config/test_analysis_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,32 @@ def test_invalid_design_matrix_format_raises_validation_error():
)


def test_design_matrix_without_design_sheet_raises_validation_error():
with pytest.raises(ConfigValidationError, match="Missing required DESIGN_SHEET"):
AnalysisConfig.from_dict(
{
ConfigKeys.DESIGN_MATRIX: [
"my_matrix.txt",
"DESIGN_:design",
"DEFAULT_SHEET:default",
],
}
)


def test_design_matrix_without_default_sheet_raises_validation_error():
with pytest.raises(ConfigValidationError, match="Missing required DEFAULT_SHEET"):
AnalysisConfig.from_dict(
{
ConfigKeys.DESIGN_MATRIX: [
"my_matrix.txt",
"DESIGN_SHEET:design",
"DEFAULT_:default",
],
}
)


def test_invalid_min_realization_percentage_raises_config_validation_error():
with pytest.raises(
ConfigValidationError,
Expand Down

0 comments on commit 9a0fd2c

Please sign in to comment.