Skip to content

Commit

Permalink
Added demonstration of the issue with string waveform
Browse files Browse the repository at this point in the history
  • Loading branch information
hanak committed Aug 8, 2024
1 parent eace0a1 commit 54781c2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/test_pv_unittests.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,15 @@ def test_get_with_metadata():
def test_get_string_waveform():
write('String Array: \n')
with no_simulator_updates():
nelm = int(caget(f"{pvnames.string_arr_pv}.NELM"))

pv = get_pv(pvnames.string_arr_pv)
val = pv.get()
assert (len(val) > 10)
assert isinstance(val[0], str)
assert len(val[0]) > 1
assert isinstance(val[1], str)
assert len(val[1]) > 1
for length in [1, 2, 3, nelm]:
expected = [f"ITEM {index}" for index in range(length)]
pv.put(expected)
time.sleep(0.1)
val = pv.get()
assert val.tolist() == expected, f"Length {length}"

def test_putcomplete():
write('Put with wait and put_complete (using real motor!) \n')
Expand Down

0 comments on commit 54781c2

Please sign in to comment.