fix unit tests
This commit is contained in:
@@ -337,9 +337,7 @@ class OpenCVCamera:
|
|||||||
return color_image
|
return color_image
|
||||||
|
|
||||||
def read_loop(self):
|
def read_loop(self):
|
||||||
# TODO(rcadene): implement safe exit for the threads,
|
while not self.stop_event.is_set():
|
||||||
# to avoid Segfault when main process finishes
|
|
||||||
while self.stop_event is None or not self.stop_event.is_set():
|
|
||||||
self.color_image = self.read()
|
self.color_image = self.read()
|
||||||
|
|
||||||
def async_read(self):
|
def async_read(self):
|
||||||
|
|||||||
@@ -207,7 +207,6 @@ class MockVideoCapture(cv2.VideoCapture):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
|
||||||
self._mock_dict = {
|
self._mock_dict = {
|
||||||
cv2.CAP_PROP_FPS: 30,
|
cv2.CAP_PROP_FPS: 30,
|
||||||
cv2.CAP_PROP_FRAME_WIDTH: 640,
|
cv2.CAP_PROP_FRAME_WIDTH: 640,
|
||||||
@@ -235,3 +234,6 @@ class MockVideoCapture(cv2.VideoCapture):
|
|||||||
w = self.get(cv2.CAP_PROP_FRAME_WIDTH)
|
w = self.get(cv2.CAP_PROP_FRAME_WIDTH)
|
||||||
ret = True
|
ret = True
|
||||||
return ret, self.image[f"{h}x{w}"]
|
return ret, self.image[f"{h}x{w}"]
|
||||||
|
|
||||||
|
def release(self):
|
||||||
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user