From 111862fc8cc1f2807a0105a31aac145e68c67976 Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Sun, 4 May 2025 22:47:44 +0200 Subject: [PATCH] Just call all the methods of the Amp object --- bindings/python/test_amp.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/bindings/python/test_amp.py b/bindings/python/test_amp.py index a1d0ba636..080c93428 100755 --- a/bindings/python/test_amp.py +++ b/bindings/python/test_amp.py @@ -20,3 +20,36 @@ class TestClass: assert amp is not None assert amp.open() is None assert amp.close() is None + + + def test_all_methods(self): + """Just call all the methods""" + amp = Hamlib.Amp(AMP_MODEL) + assert amp is not None + + # the tests that do not depend on open() + assert amp.set_conf("", "") is None + assert amp.get_conf("") == "" + assert amp.get_conf(0) == "" + conf = amp.get_conf("mcfg") + assert isinstance(conf, str) + assert amp.set_conf("mcfg", "foo") is None + conf = amp.get_conf("mcfg") + assert conf == "" # FIXME: should return "foo" + assert amp.token_lookup("") is None + + # the tests that depend on open() + assert amp.state.comm_state == 0 + assert amp.open() is None + assert amp.state.comm_state == 1 + info = amp.get_info() + assert isinstance(info, str) + assert amp.reset(Hamlib.AMP_RESET_FAULT) is None + assert amp.set_freq(0) is None + # assert amp.get_freq() is None # FIXME: AttributeError: 'Amp' object has no attribute 'get_freq' + assert amp.set_powerstat(Hamlib.RIG_POWER_OFF) is None + # assert amp.get_powerstat() is None # FIXME: AttributeError: 'Amp' object has no attribute 'get_powerstat' + assert amp.close() is None + assert amp.state.comm_state == 0 + info = amp.get_info() + assert info is None