def test_configure_laser_detector_should_create_an_laser_detector_with_the_given_config(self, mock_camera): cam = mock_camera.return_value cam.shape = [300, 100] api = ScannerAPI() api.configure_laser_detector((0.0, 0.0, 0.0), (0.0, 0.0, 0.5)) self.assertEquals((0, 0, 0), api.laser_detector.low_bgr) self.assertEquals((127, 0, 0), api.laser_detector.high_bgr)
def test_configure_laser_detector_should_replace_the_laser_detector_on_the_video_processor_with_new_laser_detector(self, mock_camera): cam = mock_camera.return_value cam.shape = [300, 100] api = ScannerAPI() api.configure_laser_detector((0.0, 0.0, 0.0), (0.0, 0.0, 1.0)) self.assertNotEquals(api._default_laser_detector, api.video_processor.laser_detector) self.assertEquals(api.laser_detector, api.video_processor.laser_detector)
def test_configure_laser_detector_should_create_an_laser_detector_with_the_given_config( self, mock_camera): cam = mock_camera.return_value cam.shape = [300, 100] api = ScannerAPI() api.configure_laser_detector((0.0, 0.0, 0.0), (0.0, 0.0, 0.5)) self.assertEquals((0, 0, 0), api.laser_detector.low_bgr) self.assertEquals((127, 0, 0), api.laser_detector.high_bgr)
def test_configure_laser_detector_should_replace_the_existing_laser_detector_with_new_laser_detector(self, mock_camera): cam = mock_camera.return_value cam.shape = [300, 100] api = ScannerAPI() api.configure_laser_detector((0.0, 0.0, 0.0), (0.0, 0.0, 0.5)) initial = api.laser_detector api.configure_laser_detector((0.5, 0.5, 0.5), (1.0, 1.0, 1.0)) self.assertNotEquals(api.laser_detector, initial)
def test_configure_laser_detector_should_replace_the_existing_laser_detector_with_new_laser_detector( self, mock_camera): cam = mock_camera.return_value cam.shape = [300, 100] api = ScannerAPI() api.configure_laser_detector((0.0, 0.0, 0.0), (0.0, 0.0, 0.5)) initial = api.laser_detector api.configure_laser_detector((0.5, 0.5, 0.5), (1.0, 1.0, 1.0)) self.assertNotEquals(api.laser_detector, initial)
def test_configure_laser_detector_should_replace_the_laser_detector_on_the_video_processor_with_new_laser_detector( self, mock_camera): cam = mock_camera.return_value cam.shape = [300, 100] api = ScannerAPI() api.configure_laser_detector((0.0, 0.0, 0.0), (0.0, 0.0, 1.0)) self.assertNotEquals(api._default_laser_detector, api.video_processor.laser_detector) self.assertEquals(api.laser_detector, api.video_processor.laser_detector)