File tree Expand file tree Collapse file tree 3 files changed +39
-5
lines changed
Expand file tree Collapse file tree 3 files changed +39
-5
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,6 @@ source = "vcs"
3939version-file = " src/geocompy/_version.py"
4040
4141[tool .pytest .ini_options ]
42- addopts = [" -ra" ]
42+ addopts = [" -ra" , " -v " ]
4343testpaths = [" tests" , " src" , " examples" ]
4444required_plugins = " pytest-mock"
Original file line number Diff line number Diff line change @@ -180,10 +180,13 @@ def __init__(
180180 """Theodolite measurement and calculation subsystem."""
181181
182182 for i in range (retry ):
183- self ._conn .send ("\n " )
184- response = self .com .nullproc ()
185- if response .comcode and response .rpccode :
186- break
183+ try :
184+ self ._conn .send ("\n " )
185+ response = self .com .nullproc ()
186+ if response .comcode and response .rpccode :
187+ break
188+ except Exception :
189+ pass
187190
188191 sleep (1 )
189192 else :
Original file line number Diff line number Diff line change 1+ import pytest
2+
3+ from geocompy .communication import Connection
4+ from geocompy .vivatps import VivaTPS
5+
6+ from helpers_geocom import (
7+ DummyGeoComConnection ,
8+ GeoComTester
9+ )
10+
11+
12+ @pytest .fixture
13+ def tps () -> VivaTPS :
14+ return VivaTPS (DummyGeoComConnection ())
15+
16+
17+ class TestVivaTPS :
18+ def test_init (self ):
19+ conn_bad = Connection ()
20+ with pytest .raises (ConnectionError ):
21+ VivaTPS (conn_bad , retry = 1 )
22+
23+ conn_good = DummyGeoComConnection ()
24+ instrument = VivaTPS (conn_good )
25+ assert instrument ._precision == 15
26+
27+ def test_parse_response (self , tps : VivaTPS ):
28+ GeoComTester .test_parse_response (tps )
29+
30+ def test_request (self , tps : VivaTPS ):
31+ GeoComTester .test_request (tps )
You can’t perform that action at this time.
0 commit comments