MCPcopy Create free account
hub / github.com/LabPy/lantz / query_expect

Method query_expect

lantz/drivers/kentech/hri.py:56–70  ·  view source on GitHub ↗

Send a query and check that the answer contains the string. :type command: str :type read_termination: str | None :type expected: str | None

(self, command, read_termination=None, expected='ok')

Source from the content-addressed store, hash-verified

54 return super().query(command, send_args=send_args, recv_args=recv_args)
55
56 def query_expect(self, command, read_termination=None, expected='ok'):
57 """Send a query and check that the answer contains the string.
58
59 :type command: str
60 :type read_termination: str | None
61 :type expected: str | None
62 """
63 if command and not self.recall('remote'):
64 self.log_info('Setting Remote.')
65 self.remote = True
66 self.resource.write(command)
67 ans = self.read(read_termination)
68 if expected and not expected in ans:
69 raise InstrumentError("'{}' not in '{}'".format(expected, ans))
70 return ans
71
72 @Action()
73 def clear(self):

Callers 13

remoteMethod · 0.95
revisionMethod · 0.95
trigger_logicMethod · 0.95
trigger_edgeMethod · 0.95
trigger_ecl_modeMethod · 0.95
trigger_ecl_levelMethod · 0.95
clamp_voltageMethod · 0.95
average_voltageMethod · 0.95
statusMethod · 0.95
mcpMethod · 0.95
modeMethod · 0.95

Calls 5

InstrumentErrorClass · 0.90
recallMethod · 0.80
log_infoMethod · 0.80
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected