Split the tests and remove simpler tests

Daniele Forsi IU5HKX 2025-05-25 16:31:30 +02:00
rodzic e5aa8f2c0c
commit 1c5bdce775
2 zmienionych plików z 18 dodań i 26 usunięć

Wyświetl plik

@ -14,20 +14,11 @@ 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
def test_all_methods(self):
"""Just call all the methods"""
def test_without_open(self):
"""Call all the methods that do not depend on open()"""
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) == ""
@ -36,9 +27,15 @@ class TestClass:
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()
def test_with_open(self):
"""Call all the methods that depend on open()"""
amp = Hamlib.Amp(AMP_MODEL)
assert amp is not None
assert amp.state.comm_state == 0
assert amp.open() is None
assert amp.state.comm_state == 1

Wyświetl plik

@ -14,22 +14,11 @@ 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
def test_all_methods(self):
"""Just call all the methods"""
def test_without_open(self):
"""Call all the methods that do not depend on open()"""
rot = Hamlib.Rot(ROT_MODEL)
assert rot is not None
# the tests that do not depend on open()
assert rot.set_conf("", "") is None
assert rot.get_conf("") == ""
assert rot.get_conf(0) == ""
@ -38,9 +27,15 @@ class TestClass:
assert rot.set_conf("mcfg", "foo") is None
conf = rot.get_conf("mcfg")
assert conf == "foo"
assert rot.token_lookup("") is None
# the tests that depend on open()
def test_with_open(self):
"""Call all the methods that depend on open()"""
rot = Hamlib.Rot(ROT_MODEL)
assert rot is not None
assert rot.state.comm_state == 0
assert rot.open() is None
assert rot.state.comm_state == 1