Skip to content

Commit

Permalink
Add a test for creating a ChannelReference when a VectorChannelRefere…
Browse files Browse the repository at this point in the history
…nce should be used (#12)
  • Loading branch information
cheloizaguirre authored Mar 15, 2019
1 parent 2044287 commit 7053b7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_channel_refs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from niveristand import errors
from niveristand import errors, realtimesequencetools
from niveristand.clientapi import RealTimeSequence
import pytest
from testutilities import rtseqrunner, testfunctions
Expand Down Expand Up @@ -76,6 +76,10 @@ def test_channel_ref_array_return():
RealTimeSequence(testfunc)


def test_channel_ref_for_vector_channel():
with pytest.raises(errors.VeristandError):
realtimesequencetools.run_py_as_rtseq(testfunctions.channel_ref_for_vector_channel)

@pytest.mark.skip
def test_channel_ref_array_run():
result = rtseqrunner.run_rtseq_in_VM(testfunctions.channel_ref_array_validate_getter)
Expand Down
6 changes: 6 additions & 0 deletions tests/testutilities/testfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ def channel_ref_array_return():
return a[0].value


@_decorators.nivs_rt_sequence
def channel_ref_for_vector_channel():
a = ChannelReference('Targets/Controller/Simulation Models/Models/Engine Demo/Parameters/a')
a.value = 50


@_decorators.nivs_rt_sequence
def channel_ref_array_validate_getter():
a = VectorChannelReference("Targets/Controller/Simulation Models/Models/Engine Demo/Parameters/a")
Expand Down

0 comments on commit 7053b7d

Please sign in to comment.