class TestRotation(TestCase):
    GEOFILE = ['  OMEGA=(+1.000000000000000E+00,   0) DEG          (DEFAULT=0.0)',
               '  THETA=(+2.000000000000000E+00,   0) DEG          (DEFAULT=0.0)',
               '    PHI=(+3.000000000000000E+00,   0) DEG          (DEFAULT=0.0)']

    def setUp(self):
        TestCase.setUp(self)

        self.rotation = Rotation(radians(1.0), radians(2.0), radians(3.0))

    def tearDown(self):
        TestCase.tearDown(self)

    def testskeleton(self):
        self.assertAlmostEqual(radians(1.0), self.rotation.omega_rad, 4)
        self.assertAlmostEqual(radians(2.0), self.rotation.theta_rad, 4)
        self.assertAlmostEqual(radians(3.0), self.rotation.phi_rad, 4)

    def testto_geo(self):
        lines = self.rotation.to_geo()
        self.assertEqual(3, len(lines))
        self.assertEqual(self.GEOFILE, lines)
Пример #2
0
class TestRotation(TestCase):
    GEOFILE = [
        '  OMEGA=(+1.000000000000000E+00,   0) DEG          (DEFAULT=0.0)',
        '  THETA=(+2.000000000000000E+00,   0) DEG          (DEFAULT=0.0)',
        '    PHI=(+3.000000000000000E+00,   0) DEG          (DEFAULT=0.0)'
    ]

    def setUp(self):
        TestCase.setUp(self)

        self.rotation = Rotation(radians(1.0), radians(2.0), radians(3.0))

    def tearDown(self):
        TestCase.tearDown(self)

    def testskeleton(self):
        self.assertAlmostEqual(radians(1.0), self.rotation.omega_rad, 4)
        self.assertAlmostEqual(radians(2.0), self.rotation.theta_rad, 4)
        self.assertAlmostEqual(radians(3.0), self.rotation.phi_rad, 4)

    def testto_geo(self):
        lines = self.rotation.to_geo()
        self.assertEqual(3, len(lines))
        self.assertEqual(self.GEOFILE, lines)
    def setUp(self):
        TestCase.setUp(self)

        self.rotation = Rotation(radians(1.0), radians(2.0), radians(3.0))
Пример #4
0
    def setUp(self):
        TestCase.setUp(self)

        self.rotation = Rotation(radians(1.0), radians(2.0), radians(3.0))