Beispiel #1
0
 def test_calling_move_to_changes_z_height_only_after_delay(self):
     expected_height = 10.0
     expected_delay = 0.250
     test_zaxis = PhotoZAxis(0.0, expected_delay)
     test_zaxis.move_to(expected_height)
     self.assertEquals(0, test_zaxis.current_z_location_mm())
     time.sleep(expected_delay)
     self.assertEquals(expected_height, test_zaxis.current_z_location_mm())
Beispiel #2
0
 def test_should_call_callback_when_something_changes(self):
     expected_height = 10.0
     expected_delay = 0.0
     test_zaxis = PhotoZAxis(0.0, expected_delay, call_back=self.call_back)
     test_zaxis.move_to(expected_height)
     test_zaxis.current_z_location_mm()
     self.assertEquals(expected_height, self.height)
     self.assertEquals(0, self.drips)
     self.assertEquals(0, self.drips_per_second)
Beispiel #3
0
    def test_set_call_back_should_add_callback(self):
        expected_height1 = 10.0
        expected_height2 = 20.0
        expected_delay = 0.0
        test_zaxis = PhotoZAxis(0.0, expected_delay, call_back=None)
        test_zaxis.move_to(expected_height1)
        test_zaxis.current_z_location_mm()
        self.assertEquals(0, self.height)
        self.assertEquals(0, self.drips)
        self.assertEquals(0, self.drips_per_second)

        test_zaxis.set_call_back(self.call_back)

        test_zaxis.move_to(expected_height2)
        test_zaxis.current_z_location_mm()
        self.assertEquals(expected_height2, self.height)
        self.assertEquals(0, self.drips)
        self.assertEquals(0, self.drips_per_second)
Beispiel #4
0
 def test_calling_move_to_changes_z_height_when_delay_0(self):
     expected_height = 10.0
     test_zaxis = PhotoZAxis(0.0, 0.0)
     test_zaxis.move_to(expected_height)
     self.assertEquals(expected_height, test_zaxis.current_z_location_mm())