use tolerance when comparing values
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import time
|
||||
import math
|
||||
|
||||
|
||||
def reread_limits_from_hw(motor):
|
||||
@@ -15,7 +16,11 @@ def reread_limits_from_hw(motor):
|
||||
time.sleep(2)
|
||||
|
||||
# Values should have been reread
|
||||
assert motor.read_field('highlimit') == high_limit
|
||||
assert motor.read_field('lowlimit') == low_limit
|
||||
assert motor.read_field('dialhighlimit') == high_limit
|
||||
assert motor.read_field('diallowlimit') == low_limit
|
||||
assert math.isclose(motor.read_field('highlimit'),
|
||||
high_limit, rel_tol=1e-9, abs_tol=0.001)
|
||||
assert math.isclose(motor.read_field('lowlimit'),
|
||||
low_limit, rel_tol=1e-9, abs_tol=0.001)
|
||||
assert math.isclose(motor.read_field('dialhighlimit'),
|
||||
high_limit, rel_tol=1e-9, abs_tol=0.001)
|
||||
assert math.isclose(motor.read_field('diallowlimit'),
|
||||
low_limit, rel_tol=1e-9, abs_tol=0.001)
|
||||
|
||||
Reference in New Issue
Block a user