Skip to content

Commit b6a0402

Browse files
committed
add tests
1 parent 75690f3 commit b6a0402

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

tests/compas/geometry/test_transformations/test_transformation.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,30 @@ def test_list():
108108
assert T.list == [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0]
109109

110110

111-
def concatenate():
111+
def test_concatenated():
112112
trans1 = [1, 2, 3]
113113
angle1 = [-2.142, 1.141, -0.142]
114114
T1 = Translation.from_vector(trans1)
115115
R1 = Rotation.from_euler_angles(angle1)
116-
M1 = T1.concatenate(R1)
116+
M1 = T1.concatenated(R1)
117117
assert allclose(M1, T1 * R1)
118+
119+
120+
def test___repr__():
121+
trans = [1, 2, 3]
122+
axes = [-2.142, 1.141, -0.142]
123+
angle = 0.7854
124+
R = Rotation.from_axis_and_angle(axes, angle, point=trans)
125+
assert R == eval(repr(R))
126+
127+
128+
def test___str__():
129+
s = '[[ 0.9345, -0.0798, 0.3469, -0.8157],\n' + \
130+
' [ -0.1624, 0.7716, 0.6150, -1.2258],\n' + \
131+
' [ -0.3168, -0.6311, 0.7081, 2.4546],\n' + \
132+
' [ 0.0000, 0.0000, 0.0000, 1.0000]]\n'
133+
trans = [1, 2, 3]
134+
axes = [-2.142, 1.141, -0.142]
135+
angle = 0.7854
136+
R = Rotation.from_axis_and_angle(axes, angle, point=trans)
137+
assert s == str(R)

0 commit comments

Comments
 (0)