"""."""

import pytest

from pyquaternion import Quaternion

from association_studio.boxes import rotate_by_quat


def test_rotate1() -> None:
    q_rot = Quaternion([1.0, 0.0, 0.0, 0.5])
    q_io = Quaternion([1.0, 0.0, 0.0, 0.5])
    rotate_by_quat(q_rot, q_io)
    assert q_io.q == pytest.approx([0.75, 0.0, 0.0, 1.0])


def test_rotate2() -> None:
    q_rot = Quaternion([-1.0, 0.0, 0.0, 1.0])
    q_io = Quaternion([1.0, 0.0, 0.0, 0.0])
    rotate_by_quat(q_rot, q_io)
    assert q_io.q == pytest.approx([1.0, 0.0, 0.0, -1.0])
