Skip to content

Commit 853b0be

Browse files
committed
add unit tests
1 parent 9faae32 commit 853b0be

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/pymap3d/tests/test_aer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ def test_aer2ecef(aer, lla, xyz):
1616
assert x == approx(xyz[0])
1717
assert y == approx(xyz[1])
1818
assert z == approx(xyz[2])
19+
assert isinstance(x, float)
20+
assert isinstance(y, float)
21+
assert isinstance(z, float)
1922

2023
raer = (radians(aer[0]), radians(aer[1]), aer[2])
2124
rlla = (radians(lla[0]), radians(lla[1]), lla[2])

src/pymap3d/tests/test_vincenty_vreckon.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ def test_unit(lat, lon, srange, az, lato, lono):
3030
lat1, lon1 = vincenty.vreckon(lat, lon, srange, az)
3131

3232
assert lat1 == approx(lato)
33+
assert isinstance(lat1, float)
34+
3335
assert lon1 == approx(lono, rel=0.001)
36+
assert isinstance(lon1, float)
3437

3538

3639
def test_az_vector():

src/pymap3d/vincenty.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,10 @@ def vreckon(
450450

451451
lon2 = lon2 % 360 # follow [0, 360) convention
452452

453-
return degrees(lat2), lon2
453+
try:
454+
return degrees(lat2).squeeze()[()], lon2.squeeze()[()]
455+
except AttributeError:
456+
return degrees(lat2), lon2
454457

455458

456459
def track2(

0 commit comments

Comments
 (0)