Skip to content

Commit

Permalink
Add test for creating a ProtocolResult from dict with missing data
Browse files Browse the repository at this point in the history
Test creating a ProtocolResult from a dictionary that is missing the
n_protocol_dag_results key.
  • Loading branch information
ianmkenney committed Nov 21, 2024
1 parent 8fe3e24 commit 8d7f3b7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gufe/tests/test_protocolresult.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ def test_protocolresult_get_uncertainty(self, instance):
def test_protocolresult_default_n_protocol_dag_results(self, instance):
assert instance.n_protocol_dag_results == 0

def test_protocol_result_from_dict_missing_n_protocol_dag_results(self, instance):
protocol_result_dict_form = instance.to_dict()
assert DummyProtocolResult.from_dict(protocol_result_dict_form) == instance
del protocol_result_dict_form['n_protocol_dag_results']
assert DummyProtocolResult.from_dict(protocol_result_dict_form) == instance

@pytest.mark.parametrize(
"arg, expected", [(0, 0), (1, 1), (-1, ValueError)]
)
Expand Down

0 comments on commit 8d7f3b7

Please sign in to comment.