Esempio n. 1
0
 def test_compute_always_calls_compute_on_extractor_for_opecv2(self):
     OpencvDetectorInterface.OPENCV_MAJOR = "2"
     image = Mock()
     keypoints = Mock()
     extractor = Mock()
     extractor.compute = Mock(return_value = ([],[]))
     interface = OpencvDetectorInterface()
     interface.compute(image, keypoints, extractor, Mock())
     extractor.compute.assert_called_once_with(image, keypoints)
Esempio n. 2
0
 def test_opecv3_when_extractor_is_none_than_compute_called_on_detector(self):
     OpencvDetectorInterface.OPENCV_MAJOR = "3"
     image = Mock()
     keypoints = Mock()
     extractor = None
     detector = Mock()
     #extractor.compute = Mock(return_value=([], []))
     detector.compute = Mock(return_value=([], []))
     interface = OpencvDetectorInterface()
     interface.compute(image, keypoints, extractor, detector)
     detector.compute.assert_called_once_with(image, keypoints)