1
0

Removed the subdir.

This commit is contained in:
2022-07-20 15:01:07 +02:00
parent aee5e8bbd9
commit e03f1c8be8
234 changed files with 21562 additions and 456 deletions

View File

@ -0,0 +1,34 @@
"""This module asserts correct runtime behaviour of the :mod:`pyrate.plan.geometry.helpers` functions
for translation.
Note that most of the correctness is asserted by the use in
:meth:`pyrate.plan.geometry.PolarPolygon.translate` and :meth:`pyrate.plan.geometry.PolarRoute.translate`.
Also, no extensive tests are needed since we trust the underlying library due to its widespread adoption and
maturity.
We only need to check that the conversion of parameters and results works as expcted.
"""
# Testing
from unittest import TestCase
# Scientific (testing)
from numpy import array
# Module under test
from pyrate.plan.geometry.helpers import translate_numpy
class TestTranslate(TestCase):
"""Tests the translation helpers."""
COORDINATES = array([[1.0, 2.0], [3.0, -4.0], [-5.0, 6.0]])
DIRECTIONS = array([0.0, 90.0, -90.0])
DISTANCES = array([1.0, 100.0, 10000.0])
def test_translate_numpy(self) -> None: # pylint: disable=no-self-use
"""Test that any combination of types of input are accepted."""
translate_numpy(TestTranslate.COORDINATES, TestTranslate.DIRECTIONS, TestTranslate.DISTANCES)
translate_numpy(TestTranslate.COORDINATES, 90, TestTranslate.DISTANCES)
translate_numpy(TestTranslate.COORDINATES, TestTranslate.DIRECTIONS, 100)
translate_numpy(TestTranslate.COORDINATES, 90, 100)