aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien Lahoudere <fabien.lahoudere@collabora.com>2019-11-26 14:24:19 +0100
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>2019-12-06 00:08:35 +0100
commit0054fac2fa79301ac1585fe61fd82d3240be2005 (patch)
tree6b7fd88fcac7938839390307ca2e7bbaad7666a3
parent6b3273b484669ecc0f0a0c3b12cbd2858b99ecd7 (diff)
downloadcros-ec-tests-0054fac2fa79301ac1585fe61fd82d3240be2005.tar.gz
test_cros_ec_accel_iio_data_is_valid: Fix the use of local variables
ACCEL_1G_IN_MS2 and ACCEL_MAG_VALID_OFFSET variables are not global to the class but local to the function. Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
-rwxr-xr-xtest-cros-ec.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/test-cros-ec.py b/test-cros-ec.py
index 8bb9b74..dbbbdc6 100755
--- a/test-cros-ec.py
+++ b/test-cros-ec.py
@@ -267,8 +267,8 @@ class TestCrosEC(unittest.TestCase):
if devtype.startswith("cros-ec-accel"):
location = read_sysfs_file(base_path + "location")
accel_scale = float(read_sysfs_file(base_path + "scale"))
- exp = self.ACCEL_1G_IN_MS2
- err = exp * self.ACCEL_MAG_VALID_OFFSET
+ exp = ACCEL_1G_IN_MS2
+ err = exp * ACCEL_MAG_VALID_OFFSET
mag = 0
for axis in ['x', 'y', 'z']:
axis_path = base_path + "in_accel_" + axis + "_raw"