test_collinear.py 629 B

1234567891011121314151617181920
  1. import pytest
  2. from freesurfer_surface.geometry import _collinear
  3. @pytest.mark.parametrize(('vector_a', 'vector_b', 'collinear'), [
  4. ([1, 0, 0], [1, 0, 0], True),
  5. ([1, 0, 0], [2, 0, 0], True),
  6. ([1, 0, 0], [-2, 0, 0], True),
  7. ([1, 0, 0], [-2, 0, 0], True),
  8. ([1, 2, 3], [1, 2, 3], True),
  9. ([1, 2, 3], [1, 2, 4], False),
  10. ([1, 2, 3], [2, 4, 6], True),
  11. ([1, 2, 3], [2, 4, 7], False),
  12. ([1, 2, 3], [2, 5, 6], False),
  13. ([1, 2, 3], [3, 4, 6], False),
  14. ])
  15. def test__collinear(vector_a, vector_b, collinear):
  16. # pylint: disable=protected-access
  17. assert _collinear(vector_a, vector_b) == collinear