"""."""

import pytest

from nuscenes.utils.data_classes import Box
from pyquaternion import Quaternion
from pytest_mock import MockerFixture

from association_studio.app.back import AssociationStudioBackend


def test_upd_scores_and_probe(be: AssociationStudioBackend, mocker: MockerFixture) -> None:
    ori = Quaternion(7.0, 8.0, 9.0, 10.0)
    be.box_trk = Box(center=[1.0, 2.0, 3.0], size=[4.0, 5.0, 6.0], orientation=ori)
    mock_upd_patches = mocker.patch.object(be, 'upd_trk_patches')
    be.upd_scores_and_probe()
    mock_upd_patches.assert_called_once()
    ref = [0.3812619345104788, 0.0002960447300568554, 0.0007229044081617246, 0.6602564102564102]
    assert be.score_driver.scores == pytest.approx(ref)
