Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Jan 5, 2024
1 parent d2dbac5 commit d7cc4ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/tests/test_swig_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,14 +509,16 @@ def test_rdataview(sbml_example_presimulation_module):
model_module = sbml_example_presimulation_module
model = model_module.getModel()
rdata = amici.runAmiciSimulation(model, model.getSolver())

assert isinstance(rdata, amici.ReturnDataView)

# fields are accessible via dot notation and [] operator,
# __contains__ and __getattr__ are implemented correctly
with pytest.raises(AttributeError):
_ = rdata.nonexisting_attribute

with pytest.raises(KeyError):
_ = rdata["nonexisting_attribute"]

assert not hasattr(rdata, "nonexisting_attribute")
assert "x" in rdata
assert rdata.x == rdata["x"]
Expand Down

0 comments on commit d7cc4ab

Please sign in to comment.