class TestFiveCirclePlugin(object):
    def setup_method(self):
        self.geometry = Fivec()

    def testGetName(self):
        assert self.geometry.name == "fivec"

    def testPhysicalAnglesToInternalPosition(self):
        expected = self.geometry.physical_angles_to_internal_position(
            (1, 2, 4, 5, 6))
        assert VliegPosition(1, 2, 0, 4, 5, 6) == expected

    def testInternalPositionToPhysicalAngles(self):
        result = self.geometry.internal_position_to_physical_angles(
            VliegPosition(1, 2, 0, 4, 5, 6))
        assert (norm(matrix([[1, 2, 4, 5, 6]]) -
                     (matrix([list(result)]))) < 0.001)

    def testSupportsModeGroup(self):
        assert self.geometry.supports_mode_group('fourc')
        assert not self.geometry.supports_mode_group('fivecFixedAlpha')
        assert self.geometry.supports_mode_group('fivecFixedGamma')

    def testGetFixedParameters(self):
        self.geometry.fixed_parameters  # check for exceptions

    def testisParamaterFixed(self):
        assert not self.geometry.parameter_fixed('made up parameter')
        assert self.geometry.parameter_fixed('gamma')
Пример #2
0
class TestFiveCirclePlugin(unittest.TestCase):

    def setUp(self):
        self.geometry = Fivec()

    def testGetName(self):
        self.assertEqual(self.geometry.name, "fivec")

    def testPhysicalAnglesToInternalPosition(self):
        expected = self.geometry.physical_angles_to_internal_position(
            (1, 2, 4, 5, 6))
        self.assert_(VliegPosition(1, 2, 0, 4, 5, 6) == expected)

    def testInternalPositionToPhysicalAngles(self):
        result = self.geometry.internal_position_to_physical_angles(
            VliegPosition(1, 2, 0, 4, 5, 6))
        self.assert_(norm(matrix([[1, 2, 4, 5, 6]]) - (matrix([list(result)])))
                     < 0.001)

    def testSupportsModeGroup(self):
        self.assertTrue(self.geometry.supports_mode_group('fourc'))
        self.assertFalse(self.geometry.supports_mode_group('fivecFixedAlpha'))
        self.assertTrue(self.geometry.supports_mode_group('fivecFixedGamma'))

    def testGetFixedParameters(self):
        self.geometry.fixed_parameters  # check for exceptions

    def testisParamaterFixed(self):
        self.assertFalse(self.geometry.parameter_fixed('made up parameter'))
        self.assertTrue(self.geometry.parameter_fixed('gamma'))