Skip to content

Commit

Permalink
test 1 units
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamCPinchbeck committed Sep 4, 2024
1 parent 02b3540 commit 4d9efa0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_1_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from gammabayes import update_with_defaults, haversine

from astropy import units as u

def test_update_with_defaults():
test_default = {'a':1, 'b':2, 'c':3, 'd':4}
Expand All @@ -10,8 +10,8 @@ def test_update_with_defaults():
assert test_target == {'a':[1,2,3,4], 'b':2, 'c':'This is a test ya c', 'd':4}

def test_haversine():
lon1, lat1, lon2, lat2 = 0,0,0,0
assert haversine(lon1, lat1, lon2, lat2) == 0
lon1, lat1, lon2, lat2 = 0*u.deg,0*u.deg,0*u.deg,0*u.deg
assert haversine(lon1, lat1, lon2, lat2).value == 0

lon1, lat1, lon2, lat2 = 180,0,0,0
assert haversine(lon1, lat1, lon2, lat2) == 180
lon1, lat1, lon2, lat2 = 180*u.deg,0*u.deg,0*u.deg,0*u.deg
assert haversine(lon1, lat1, lon2, lat2).value == 180

0 comments on commit 4d9efa0

Please sign in to comment.