From e895cfcdfe5366665d4b9a138d9b1005a916e5dc Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Sun, 4 May 2025 21:42:10 +0200 Subject: [PATCH] Add a minimal test for dummy amplifier --- bindings/python/test_amp.py | 22 ++++++++++++++++++++++ bindings/python/test_rot.py | 0 2 files changed, 22 insertions(+) create mode 100755 bindings/python/test_amp.py mode change 100644 => 100755 bindings/python/test_rot.py diff --git a/bindings/python/test_amp.py b/bindings/python/test_amp.py new file mode 100755 index 000000000..a1d0ba636 --- /dev/null +++ b/bindings/python/test_amp.py @@ -0,0 +1,22 @@ +#! /bin/env pytest +"""Tests of the Python bindings for Hamlib + +Running this script directly will use the installed bindings. +For an in-tree run use "make check", or set PYTHONPATH to point to +the directories containing Hamlib.py and _Hamlib.so. +""" +import Hamlib + +Hamlib.rig_set_debug(Hamlib.RIG_DEBUG_NONE) + +AMP_MODEL = Hamlib.AMP_MODEL_DUMMY + +class TestClass: + """Container class for tests""" + + def test_open_close(self): + """Smoke test""" + amp = Hamlib.Amp(AMP_MODEL) + assert amp is not None + assert amp.open() is None + assert amp.close() is None diff --git a/bindings/python/test_rot.py b/bindings/python/test_rot.py old mode 100644 new mode 100755