|
5 | 5 | For an in-tree run use "make check", or set PYTHONPATH to point to |
6 | 6 | the directories containing Hamlib.py and _Hamlib.so. |
7 | 7 | """ |
| 8 | +import pytest |
8 | 9 | from pytest import raises |
9 | 10 |
|
10 | 11 | import Hamlib |
@@ -49,12 +50,18 @@ def test_without_open(self, model): |
49 | 50 | assert rot.token_lookup("") is None |
50 | 51 |
|
51 | 52 |
|
52 | | - def test_with_open(self, model): |
| 53 | + @pytest.mark.skipif('config.getoption("model") != Hamlib.ROT_MODEL_DUMMY') |
| 54 | + def test_with_open(self, model, rot_file, serial_speed): |
53 | 55 | """Call all the methods that depend on open()""" |
54 | 56 | rot = Hamlib.Rot(model) |
55 | 57 | assert rot is not None |
56 | 58 |
|
57 | 59 | assert rot.state.comm_state == 0 |
| 60 | + # first try a known string because rot_file is None during "make check" |
| 61 | + assert rot.set_conf("rot_pathname", "foo") is None |
| 62 | + assert rot.get_conf("rot_pathname") == "foo" |
| 63 | + assert rot.set_conf("rot_pathname", rot_file) is None |
| 64 | + assert rot.set_conf("serial_speed", str(serial_speed)) is None |
58 | 65 | assert rot.open() is None |
59 | 66 | assert rot.state.comm_state == 1 |
60 | 67 | info = rot.get_info() |
@@ -108,6 +115,7 @@ def test_with_open(self, model): |
108 | 115 | assert info is None |
109 | 116 |
|
110 | 117 |
|
| 118 | + @pytest.mark.skipif('config.getoption("model") != Hamlib.ROT_MODEL_DUMMY') |
111 | 119 | def test_object_creation(self, model): |
112 | 120 | """Create all objects available""" |
113 | 121 | rot = Hamlib.Rig(model) |
|
0 commit comments