MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / test_with_open

Method test_with_open

bindings/python/test_rig.py:211–240  ·  view source on GitHub ↗

Call all the methods that depend on open()

(self, model, rig_file, serial_speed)

Source from the content-addressed store, hash-verified

209
210
211 def test_with_open(self, model, rig_file, serial_speed):
212 """Call all the methods that depend on open()"""
213 rig = Hamlib.Rig(model)
214 assert rig is not None
215
216 assert rig.state.comm_state == 0
217 assert rig.state.comm_status == Hamlib.RIG_COMM_STATUS_DISCONNECTED
218 assert rig.set_conf("rig_pathname", rig_file) is None
219 assert rig.set_conf("serial_speed", str(serial_speed)) is None
220 assert rig.open() is None
221 assert rig.state.comm_state == 1
222 assert rig.state.comm_status == Hamlib.RIG_COMM_STATUS_OK
223 info = rig.get_info()
224 assert isinstance(info, str)
225
226 self.do_test_frequency(rig)
227 self.do_test_vfo(rig)
228 self.do_test_rit_xit(rig)
229 self.do_test_antenna(rig)
230 self.do_test_squelch(rig)
231 self.do_test_callback(rig)
232 # When using the Dummy driver, rig.c replies with a copy of the data
233 if model == Hamlib.RIG_MODEL_DUMMY:
234 self.do_test_send_raw(rig)
235
236 assert rig.close() is None
237 assert rig.state.comm_state == 0
238 assert rig.state.comm_status == Hamlib.RIG_COMM_STATUS_DISCONNECTED
239 info = rig.get_info()
240 assert info is None
241
242
243 @pytest.mark.skipif('config.getoption("model") != Hamlib.RIG_MODEL_DUMMY')

Callers

nothing calls this directly

Calls 10

openMethod · 0.95
do_test_frequencyMethod · 0.95
do_test_vfoMethod · 0.95
do_test_rit_xitMethod · 0.95
do_test_antennaMethod · 0.95
do_test_squelchMethod · 0.95
do_test_callbackMethod · 0.95
do_test_send_rawMethod · 0.95
closeMethod · 0.95
RigMethod · 0.80

Tested by

no test coverage detected