aboutsummaryrefslogtreecommitdiff
path: root/tests/test_angles.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_angles.py')
-rwxr-xr-xtests/test_angles.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/test_angles.py b/tests/test_angles.py
index 4408431..6309c96 100755
--- a/tests/test_angles.py
+++ b/tests/test_angles.py
@@ -11,7 +11,9 @@ import pytest
from thcolor.angles import * # NOQA
-class TestAngle:
+class TestAngles:
+ """ Test angle definitions and conversions. """
+
@pytest.mark.parametrize('fst,snd', (
(GradiansAngle(.1), GradiansAngle(.2)),
))
@@ -41,5 +43,15 @@ class TestAngle:
assert isinstance(angle, type(expected))
assert angle == expected
+ @pytest.mark.parametrize('rad,deg', (
+ (0, 0),
+ (-pi / 2, 270),
+ (pi / 2, 90),
+ (3 * pi / 4, 135),
+ (-3 * pi / 4, 225),
+ ))
+ def test_radians_to_degrees(self, rad, deg):
+ return RadiansAngle(rad).asprincipal().asdegrees().degrees == deg
+
# End of file.