From 36beb2553bb9ef0879d152e74ca95aec7f21970a Mon Sep 17 00:00:00 2001 From: Kaushik Malapati Date: Mon, 22 Jul 2024 20:00:22 -0700 Subject: [PATCH] Adding test cases for input/output record write access --- pytmc/tests/test_record.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pytmc/tests/test_record.py b/pytmc/tests/test_record.py index decf541..dfb7fa3 100644 --- a/pytmc/tests/test_record.py +++ b/pytmc/tests/test_record.py @@ -35,6 +35,31 @@ def test_epics_record_with_linter(dbd_file): assert not (linted.errors) +def test_input_record_without_write_access(): + kwargs = { + "pvname": "Tst:pv", + "record_type": "ai", + "direction": "input", + } + + ec = EPICSRecord(**kwargs) + record = ec.render() + assert "ASG" in record + assert "NO_WRITE" in record + + +def test_output_record_with_write_access(): + kwargs = { + "pvname": "Tst:pv", + "record_type": "ao", + "direction": "output", + } + + ec = EPICSRecord(**kwargs) + record = ec.render() + assert "ASG" not in record + + def test_sort_fields(): unsorted_entry = OrderedDict( [