def test_bad_sequence(self): with self.assertRaises(AssertionError): dcs.quat_to_euler(self.zero_quat, np.array([1, 2]))
def test_all_valid(self): # TODO: this doesn't confirm that all of these give the correct answer, but just don't crash for this_seq in self.valid_sequences: euler = dcs.quat_to_euler(self.zero_quat, np.array(this_seq)) np.testing.assert_array_equal(euler, np.zeros(3))
def test_all_invalid(self): for this_seq in self.bad_sequences: with self.assertRaises(ValueError): dcs.quat_to_euler(self.zero_quat, np.array(this_seq))
def test_nominal(self): euler = dcs.quat_to_euler(self.quat, self.seq) np.testing.assert_array_almost_equal(euler, self.euler)
def test_zero_quat(self): euler = dcs.quat_to_euler(self.zero_quat) np.testing.assert_array_equal(euler, np.zeros(3))