Skip to content

Commit

Permalink
TST add delay after .reset()
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Jan 26, 2022
1 parent a7521f3 commit 3ab8a7e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions apstools/synApps/tests/test_calcout.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ..calcout import UserCalcoutDevice
from ...tests import common_attribute_quantities_test
from ...tests import IOC
from ...tests import short_delay_for_EPICS_IOC_database_processing


@pytest.mark.parametrize(
Expand Down Expand Up @@ -45,6 +46,7 @@ def test_calcout_reset():
assert v1 < calcout.calculated_value.get()

calcout.reset()
short_delay_for_EPICS_IOC_database_processing()
assert calcout.description.get() == calcout.prefix
assert calcout.calculation.get() == "0"
v1 = calcout.calculated_value.get()
Expand Down
5 changes: 4 additions & 1 deletion apstools/synApps/tests/test_luascript.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def test_luascript_reset():
assert lua.inputs.BB.input_value.get() != ""

lua_all.reset()
short_delay_for_EPICS_IOC_database_processing()

assert lua.precision.get() == 5
assert lua.code.get() == ""
Expand Down Expand Up @@ -112,6 +113,7 @@ def test_compute(code, a, b, nval, aa, bb, sval):
assert lua_all.enable.get(as_string=True) == "Enable"

lua_all.reset()
short_delay_for_EPICS_IOC_database_processing()

lua = lua_all.script9
lua.disable_value.put(2) # ensure record is always enabled
Expand Down Expand Up @@ -139,7 +141,8 @@ def test_compute(code, a, b, nval, aa, bb, sval):
assert round(lua.number_value.get(), 5) == nval
assert lua.string_value.get() == sval

lua.reset()
lua_all.reset()
short_delay_for_EPICS_IOC_database_processing()

# -----------------------------------------------------------------------------
# :author: Pete R. Jemian
Expand Down
2 changes: 2 additions & 0 deletions apstools/synApps/tests/test_scalcout.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def test_scalcout_reset():
assert isinstance(calc, ScalcoutRecord)

calc.reset()
short_delay_for_EPICS_IOC_database_processing()
assert calc.enable.get() in [1, "E"]

# set some things
Expand All @@ -52,6 +53,7 @@ def test_scalcout_reset():
assert calc.calculated_value_string.get() == str(v)

calc.reset()
short_delay_for_EPICS_IOC_database_processing()
assert calc.description.get() == calc.prefix
assert calc.calculation.get() == "0"
assert calc.channels.A.input_value.get() == 0
Expand Down
1 change: 1 addition & 0 deletions apstools/synApps/tests/test_sseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def test_sseq_reset():
assert step.string_value.get() <= uptime.get()

user.reset()
short_delay_for_EPICS_IOC_database_processing()
assert step.input_pv.get() == ""
assert step.string_value.get() == f"{0:.5f}"

Expand Down

0 comments on commit 3ab8a7e

Please sign in to comment.