From 3b79b13f6d521a955faeac4274237478dcaeb57e Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Mon, 11 Aug 2025 23:41:39 +0200 Subject: [PATCH] Make the tests for set_conf() and get_conf() more meaningful --- bindings/python/test_amp.py | 14 +++++++++----- bindings/python/test_rig.py | 11 ++++++----- bindings/python/test_rot.py | 11 ++++++----- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/bindings/python/test_amp.py b/bindings/python/test_amp.py index 1a0b5eac3..4f8608761 100755 --- a/bindings/python/test_amp.py +++ b/bindings/python/test_amp.py @@ -27,11 +27,15 @@ class TestClass: 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" + if model == Hamlib.AMP_MODEL_DUMMY: + conf = amp.get_conf("mcfg") + assert conf == "" + assert amp.set_conf("mcfg", "foobar") is None + conf = amp.get_conf("mcfg") + assert conf == "" # FIXME: should return "foobar" + else: + conf = amp.get_conf("mcfg") + assert conf == "" assert amp.token_lookup("") is None diff --git a/bindings/python/test_rig.py b/bindings/python/test_rig.py index 5c0c305ec..a7545bd8e 100755 --- a/bindings/python/test_rig.py +++ b/bindings/python/test_rig.py @@ -29,13 +29,14 @@ class TestClass: assert rig.set_conf("", "") is None assert rig.get_conf("") == "" assert rig.get_conf(0) == "" - conf = rig.get_conf("mcfg") - assert isinstance(conf, str) - assert rig.set_conf("mcfg", "foo") is None - conf = rig.get_conf("mcfg") if model == Hamlib.RIG_MODEL_DUMMY: - assert conf == "foo" + conf = rig.get_conf("mcfg") + assert conf == "DX" + assert rig.set_conf("mcfg", "foobar") is None + conf = rig.get_conf("mcfg") + assert conf == "foobar" else: + conf = rig.get_conf("mcfg") assert conf == "" assert rig.token_lookup("") is None diff --git a/bindings/python/test_rot.py b/bindings/python/test_rot.py index c87835534..73cce79af 100755 --- a/bindings/python/test_rot.py +++ b/bindings/python/test_rot.py @@ -36,13 +36,14 @@ class TestClass: assert rot.set_conf("", "") is None assert rot.get_conf("") == "" assert rot.get_conf(0) == "" - conf = rot.get_conf("mcfg") - assert isinstance(conf, str) - assert rot.set_conf("mcfg", "foo") is None - conf = rot.get_conf("mcfg") if model == Hamlib.ROT_MODEL_DUMMY: - assert conf == "foo" + conf = rot.get_conf("mcfg") + assert conf == "ROTATOR" + assert rot.set_conf("mcfg", "foobar") is None + conf = rot.get_conf("mcfg") + assert conf == "foobar" else: + conf = rot.get_conf("mcfg") assert conf == "" assert rot.token_lookup("") is None