test_into_lines.py 765 B

123456789101112131415161718192021222324
  1. # Testing that all variants of CollisionLine
  2. # cannot be used as "into" objects
  3. from collisions import *
  4. def test_sphere_into_line():
  5. entry = make_collision(CollisionSphere(0, 0, 0, 3), CollisionLine(0, 0, 0, 1, 0, 0))[0]
  6. assert entry is None
  7. def test_sphere_into_ray():
  8. entry = make_collision(CollisionSphere(0, 0, 0, 3), CollisionRay(0, 0, 0, 3, 3, 3))[0]
  9. assert entry is None
  10. def test_sphere_into_segment():
  11. entry = make_collision(CollisionSphere(0, 0, 0, 3), CollisionSegment(0, 0, 0, 3, 3, 3))[0]
  12. assert entry is None
  13. def test_sphere_into_parabola():
  14. parabola = LParabola((1, 0, 0), (0, 1, 0), (0, 0, 1))
  15. entry = make_collision(CollisionSphere(0, 0, 0, 3), CollisionParabola(parabola, 1, 2))[0]
  16. assert entry is None