Пример #1
0
    def test_that_XY_increment_is_larger_than_tolerance(self):
        # Arrange
        increment_coord1 = 1
        increment_coord2 = 2
        tolerance = 0.2
        provider = cf.PositionProviderXY(increment_coord1,increment_coord2,tolerance)

        # Act
        is_smaller_coord1 = provider.is_coord1_increment_smaller_than_tolerance()
        is_smaller_coord2 = provider.is_coord2_increment_smaller_than_tolerance()

        # Assert
        self.assertFalse(is_smaller_coord1)
        self.assertFalse(is_smaller_coord2)
Пример #2
0
    def test_that_XY_increment_provider_halves_the_step(self):
        # Arrange
        increment_coord1 = 1
        increment_coord2 = 2
        tolerance = 200
        provider = cf.PositionProviderXY(increment_coord1,increment_coord2,tolerance)

        # Act and Assert
        self.assertTrue(increment_coord1 == provider.get_increment_coord1())
        self.assertTrue(increment_coord2 == provider.get_increment_coord2())

        provider.half_and_reverse_increment_coord1()
        provider.half_and_reverse_increment_coord2()

        self.assertTrue(-increment_coord1/2.0 == provider.get_increment_coord1())
        self.assertTrue(-increment_coord2/2.0 == provider.get_increment_coord2())