Skip to content

Commit

Permalink
Add test for resdata consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
xjules committed Sep 11, 2024
1 parent 3d6896e commit 82600b6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/unit_tests/shared/test_rate_keys.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import hypothesis.strategies as st
from hypothesis import given
from resdata.summary import Summary

from ert.shared.storage.summary_key_utils import is_rate
from tests.unit_tests.config.summary_generator import summary_variables


def nonempty_string_without_whitespace():
Expand All @@ -12,7 +14,6 @@ def nonempty_string_without_whitespace():

@given(key=nonempty_string_without_whitespace())
def test_is_rate_does_not_raise_error(key):
print(key)
is_rate_bool = is_rate(key)
assert isinstance(is_rate_bool, bool)

Expand Down Expand Up @@ -52,3 +53,8 @@ def test_is_rate_determmines_rate_key(example):
key, rate = example
is_rate_bool = is_rate(key)
assert is_rate_bool == rate


@given(key=summary_variables())
def test_rate_determination_is_consinsent(key):
assert Summary.is_rate(key) == is_rate(key)

0 comments on commit 82600b6

Please sign in to comment.