From 78b0f78e8100bbcfd15f4e4168e5caba8a6d3edf Mon Sep 17 00:00:00 2001 From: Nicolas Braud-Santoni Date: Fri, 12 Oct 2018 22:18:49 -0400 Subject: [PATCH] test_reflect_prop: Add a property tying reflect() and angle() --- tests/test_vector2_reflect.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_vector2_reflect.py b/tests/test_vector2_reflect.py index c0a62ca2..cb0f3e01 100644 --- a/tests/test_vector2_reflect.py +++ b/tests/test_vector2_reflect.py @@ -2,7 +2,7 @@ import pytest from hypothesis import given, assume, note from math import isclose, isinf -from utils import units, vectors +from utils import angle_isclose, units, vectors reflect_data = ( @@ -28,3 +28,6 @@ def test_reflect_prop(initial: Vector2, normal: Vector2): assert not any(map(isinf, reflected)) assert initial.isclose(returned) assert isclose((initial * normal), -(reflected * normal)) + assert angle_isclose(normal.angle(initial), + 180 - normal.angle(reflected) + )