Skip to content

Commit

Permalink
Corrections in test_get_rate_safe
Browse files Browse the repository at this point in the history
  • Loading branch information
MCruces-fz committed Mar 17, 2021
1 parent d4fb9a9 commit 20b649f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions invisible_cities/detsim/sensor_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,16 @@ def test_create_timestamp_greater_with_greater_eventnumber():
assert abs(timestamp_2) == timestamp_2


@mark.filterwarnings("ignore:Zero rate")
@mark.filterwarnings("ignore:Zero rate" )
@mark.filterwarnings("ignore:Negative rate")
def test_get_rate_safe_allways_possitive():
"""
Be sure that it woll always return the rate value such that
it is never unphysical.
Check the rate is always physical.
"""

rate = 0
assert get_rate_safe(rate) > 0
rate_1 = 0. * units.hertz
rate_2 = - 0.42 * units.hertz

assert get_rate_safe(rate_1) == 0.5 * units.hertz
assert get_rate_safe(rate_2) == 0.42 * units.hertz

0 comments on commit 20b649f

Please sign in to comment.