diff --git a/tests/test_estimators.py b/tests/test_estimators.py index 64b04e9..46e6ef2 100644 --- a/tests/test_estimators.py +++ b/tests/test_estimators.py @@ -822,6 +822,11 @@ def test_wrong_input_vector_types(self): self.assertRaises(TypeError, ahrs.filters.Tilt, acc=['1.0', '2.0', '3.0'], mag=[2.0, 3.0, 4.0]) self.assertRaises(TypeError, ahrs.filters.Tilt, acc=[1.0, 2.0, 3.0], mag=['2.0', '3.0', '4.0']) + def test_zero_magnetic_field(self): + self.assertRaises(ValueError, ahrs.filters.Tilt, acc=self.accelerometers[0], mag=np.zeros(3)) + tilt = ahrs.filters.Tilt() + self.assertRaises(ValueError, tilt.estimate, acc=self.accelerometers[0], mag=np.zeros(3)) + def test_wrong_representation(self): self.assertRaises(TypeError, ahrs.filters.Tilt, representation=1) self.assertRaises(TypeError, ahrs.filters.Tilt, acc=self.accelerometers, mag=self.magnetometers, representation=1)