Skip to content

Commit

Permalink
Add test for attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sol committed Nov 24, 2023
1 parent 7f38742 commit 4528e4e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/test_rmscollectors/test_rmsinplacevolumes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Test fuc"""
import pytest
import pandas as pd
import roxar
from fmu.dataio.rmscollectors.volumetrics import RmsInplaceVolumes

Expand All @@ -19,7 +20,7 @@ def _fix_drogon_project():
return proj


def test_inplace_volumes(drogon_project):
def test_inplace_volumes_attributes(drogon_project):
"""Test class RmsInplaceVolumes
Args:
Expand All @@ -29,3 +30,17 @@ def test_inplace_volumes(drogon_project):
assert isinstance(inplace.params, dict), (
"Params should be dictionary, but is" f" {type(inplace.params)}"
)
attr_names = ["params", "input", "output", "report", "variables"]

for attr_name in attr_names:
if attr_name == "report":
att_type = pd.DataFrame
else:
att_type = dict
assert hasattr(
inplace, attr_name
), f"No {attr_name} attribute for RmsInplaceVolumes"
attr = getattr(inplace, attr_name)
assert isinstance(
attr, att_type
), f" {attr_name} should be dictionary, but is {type(attr)}"

0 comments on commit 4528e4e

Please sign in to comment.