Skip to content

Commit 1a551ab

Browse files
committed
[test_ModelicaSystemOMC] add tests for setInputs()
1 parent 8677b86 commit 1a551ab

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/test_ModelicaSystemOMC.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,14 @@ def test_simulate_inputs(tmp_path):
439439
simOptions = {"stopTime": 1.0}
440440
mod.setSimulationOptions(**simOptions)
441441

442+
# check invalid inputs
443+
# * 'None' cannot be converted to float
444+
with pytest.raises(OMPython.ModelicaSystemError):
445+
mod.setInputs(u1=[(0.0, None), (0.5, 1)])
446+
# * 'abc' cannot be converted to float
447+
with pytest.raises(OMPython.ModelicaSystemError):
448+
mod.setInputs(u1=[(0.0, 0.0), ("abc", 1)])
449+
442450
# integrate zero (no setInputs call) - it should default to None -> 0
443451
assert mod.getInputs() == {
444452
"u1": None,

0 commit comments

Comments
 (0)