From c654cbc77fabc655684d39b69e64da79a146cd04 Mon Sep 17 00:00:00 2001 From: Daniele Forsi IU5HKX Date: Sun, 4 May 2025 18:32:33 +0200 Subject: [PATCH] Add a minimal test for dummy rotor --- bindings/python/test_rot.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 bindings/python/test_rot.py diff --git a/bindings/python/test_rot.py b/bindings/python/test_rot.py new file mode 100644 index 000000000..b936c1abb --- /dev/null +++ b/bindings/python/test_rot.py @@ -0,0 +1,24 @@ +#! /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) + +ROT_MODEL = Hamlib.ROT_MODEL_DUMMY + +class TestClass: + """Container class for tests""" + + def test_open_close(self): + """Smoke test""" + rot = Hamlib.Rot(ROT_MODEL) + assert rot is not None + assert rot.open() is None + assert rot.set_position(0.0, 0.0) is None + assert rot.get_position() is not None + assert rot.close() is None