File: test_euler.py

package info (click to toggle)
pyrr 0.10.3-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 956 kB
  • sloc: python: 5,865; makefile: 132; sh: 23
file content (25 lines) | stat: -rw-r--r-- 632 bytes parent folder | download
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
try:
    import unittest2 as unittest
except:
    import unittest
import numpy as np
from pyrr import euler


class test_euler(unittest.TestCase):
    def test_import(self):
        import pyrr
        pyrr.euler
        from pyrr import euler

    def test_create(self):
        self.assertTrue(np.array_equal(euler.create(), [0., 0., 0.]))
        e = euler.create(roll=1., pitch=2., yaw=3.)
        self.assertEqual(euler.roll(e), 1.)
        self.assertEqual(euler.pitch(e), 2.)
        self.assertEqual(euler.yaw(e), 3.)
        self.assertTrue(np.array_equal(e, [1., 2., 3.]))


if __name__ == '__main__':
    unittest.main()