from __future__ import annotations import unittest from cadfs_to_cdsl.selector_binding import _score class SelectorBindingTests(unittest.TestCase): def test_face_normal_match_is_orientation_independent(self) -> None: score = _score( {"normal": [0.0, 0.0, 1.0], "plane_offset_mm": 12.0}, {"normal": [0.0, 0.0, -1.0], "plane_offset_mm": 12.0}, ) self.assertEqual(score, 1.0) def test_axis_direction_remains_orientation_sensitive(self) -> None: score = _score( {"axis_direction": [0.0, 0.0, 1.0]}, {"axis_direction": [0.0, 0.0, -1.0]}, ) self.assertEqual(score, 0.0) def test_empty_snapshot_score_is_not_treated_as_a_match(self) -> None: self.assertEqual(_score({}, {"normal": [0.0, 0.0, 1.0]}), 0.0)