Skip to content

Commit

Permalink
TST: Check required inplace volumes columns
Browse files Browse the repository at this point in the history
  • Loading branch information
mferrera committed Dec 19, 2024
1 parent 5d4c9aa commit ac79064
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/fmu/dataio/_products/inplace_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class InplaceVolumesResultRow(BaseModel):
BULK: float = Field(ge=0.0)
NET: Optional[float] = Field(default=None, ge=0.0)
PORV: float = Field(ge=0.0)
HCPV: Optional[float] = Field(default=None, ge=0.0)
HCPV: float = Field(ge=0.0)
STOIIP: Optional[float] = Field(default=None, ge=0.0)
GIIP: Optional[float] = Field(default=None, ge=0.0)
ASSOCIATEDGAS: Optional[float] = Field(default=None, ge=0.0)
Expand Down
13 changes: 6 additions & 7 deletions tests/test_export_rms/test_export_rms_volumetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,9 @@ def test_inplace_volumes_export_and_result_columns_are_the_same(
)


def test_that_required_columns_one_to_one_in_enum_and_schema() -> None:
schema_required_fields = [
name
for name, field in InplaceVolumesResultRow.__fields__.items()
if field.required
]
assert _enums.InplaceVolumes.required_columns == schema_required_fields
def test_that_required_columns_one_to_one_in_enums_and_schema() -> None:
schema_required_fields = []
for field_name, field_info in InplaceVolumesResultRow.model_fields.items():
if field_info.is_required():
schema_required_fields.append(field_name)
assert _enums.InplaceVolumes.required_columns() == schema_required_fields

0 comments on commit ac79064

Please sign in to comment.