Skip to content

Commit

Permalink
TST: fix rpc related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nstelter-slac committed May 9, 2024
1 parent 1ca6259 commit 5ee56af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pydm/data_plugins/epics_plugins/p4p_plugin_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

logger = logging.getLogger(__name__)

# arbitrary default for non-polled RPC
DEFAULT_RPC_TIMEOUT = 5.0


Expand Down Expand Up @@ -104,7 +105,7 @@ def poll_rpc_channel(self) -> None:
result = P4PPlugin.context.rpc(
name=self._rpc_function_name, value=self._value_obj, timeout=self._rpc_poll_rate
)
except Exception as e:
except Exception:
# So widget displays name of channel when can't connect to RPC channel
self.connection_state_signal.emit(False)

Expand Down
6 changes: 3 additions & 3 deletions pydm/tests/data_plugins/test_p4p_plugin_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def test_convert_epics_nttable():
"address, expected_function_name, expected_arg_names, expected_arg_values, expected_poll_rate",
[
("pva://pv:call:add?a=4&b=7&pydm_pollrate=10", "pv:call:add", ["a", "b"], ["4", "7"], 10),
("pva://pv:call:add?a=4&b=7&", "pv:call:add", ["a", "b"], ["4", "7"], 0),
("pva://pv:call:add?a=4&b=7&", "pv:call:add", ["a", "b"], ["4", "7"], 5.0),
(
"pva://pv:call:add_three_ints_negate_option?a=2&b=7&negate=True&pydm_pollrate=10",
"pv:call:add_three_ints_negate_option",
Expand All @@ -180,9 +180,9 @@ def test_convert_epics_nttable():
"pv:call:take_return_string",
["a"],
["Hello"],
0,
5.0,
),
("", "", [], [], 0),
("", "", [], [], 0.0), # poll-rate 0 because only set to DEFAULT_RPC_TIMEOUT (5) when have realistic address
],
)
def test_parsing_rpc_channel(
Expand Down

0 comments on commit 5ee56af

Please sign in to comment.