Skip to content

Commit dcdd64f

Browse files
committed
[protocoltest] fixed GeoCom FTR tests
1 parent 83fd070 commit dcdd64f

File tree

1 file changed

+13
-2
lines changed
  • src/instrumentman/protocoltest

1 file changed

+13
-2
lines changed

src/instrumentman/protocoltest/app.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from serial import SerialException
1111
from geocompy.data import Angle
1212
from geocompy.geo import GeoCom
13+
from geocompy.geo.gcdata import Device
1314
from geocompy.geo.gctypes import GeoComCode, GeoComResponse
1415
from geocompy.gsi.dna import GsiOnlineDNA
1516
from geocompy.gsi.gsitypes import GsiOnlineResponse
@@ -23,6 +24,16 @@ def _test_geocom_mot(tps: GeoCom) -> GeoComResponse[Any]:
2324
return tps.mot.start_controller()
2425

2526

27+
def _test_geocom_ftr(tps: GeoCom) -> GeoComResponse[Any]:
28+
for device in Device:
29+
response = tps.ftr.setup_listing(device)
30+
tps.ftr.abort_list()
31+
if response.error == GeoComCode.OK:
32+
return response
33+
34+
return response
35+
36+
2637
def tests_geocom(
2738
tps: GeoCom,
2839
logger: Logger
@@ -56,7 +67,7 @@ def tests_geocom(
5667
tps.edm.switch_laserpointer,
5768
(False,)
5869
),
59-
("File Transfer", tps.ftr.setup_listing, ()),
70+
("File Transfer", _test_geocom_ftr, (tps,)),
6071
("Imaging", tps.img.get_telescopic_configuration, ()),
6172
("Keyboard Display Unit", tps.kdm.get_display_power_status, ()),
6273
("Motorization", _test_geocom_mot, (tps,)),
@@ -77,9 +88,9 @@ def tests_geocom(
7788
response = cmd(*params)
7889
if response.error == GeoComCode.OK:
7990
result = ":white_check_mark:"
80-
logger.error(f"{subsystem} unavailable ({response})")
8191
else:
8292
result = ":x:"
93+
logger.error(f"{subsystem} unavailable ({response})")
8394

8495
table.add_row(subsystem, result)
8596

0 commit comments

Comments
 (0)