forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_ode_joints.py
More file actions
43 lines (25 loc) · 847 Bytes
/
test_ode_joints.py
File metadata and controls
43 lines (25 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import pytest
def test_odejoint_attach_both(world):
from panda3d import ode
body1 = ode.OdeBody(world)
body2 = ode.OdeBody(world)
assert len(body1.joints) == 0
assert len(body2.joints) == 0
joint = ode.OdeBallJoint(world)
joint.attach(body1, body2)
assert tuple(body1.joints) == (joint,)
assert tuple(body2.joints) == (joint,)
def test_odejoint_attach_0(world):
from panda3d import ode
body = ode.OdeBody(world)
assert len(body.joints) == 0
joint = ode.OdeBallJoint(world)
joint.attach(body, None)
assert tuple(body.joints) == (joint,)
def test_odejoint_attach_1(world):
from panda3d import ode
body = ode.OdeBody(world)
assert len(body.joints) == 0
joint = ode.OdeBallJoint(world)
joint.attach(None, body)
assert tuple(body.joints) == (joint,)